Merge remote-tracking branch 'origin/master' into 1.9

# Conflicts:
#	Content/Editor/Camera/M_Camera.flax
#	Content/Editor/CubeTexturePreviewMaterial.flax
#	Content/Editor/DebugMaterials/DDGIDebugProbes.flax
#	Content/Editor/DebugMaterials/SingleColor/Decal.flax
#	Content/Editor/DebugMaterials/SingleColor/Particle.flax
#	Content/Editor/DebugMaterials/SingleColor/Surface.flax
#	Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax
#	Content/Editor/DebugMaterials/SingleColor/Terrain.flax
#	Content/Editor/DefaultFontMaterial.flax
#	Content/Editor/Gizmo/FoliageBrushMaterial.flax
#	Content/Editor/Gizmo/Material.flax
#	Content/Editor/Gizmo/MaterialWire.flax
#	Content/Editor/Gizmo/SelectionOutlineMaterial.flax
#	Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax
#	Content/Editor/Highlight Material.flax
#	Content/Editor/Icons/IconsMaterial.flax
#	Content/Editor/IesProfilePreviewMaterial.flax
#	Content/Editor/Particles/Particle Material Color.flax
#	Content/Editor/Particles/Smoke Material.flax
#	Content/Editor/SpriteMaterial.flax
#	Content/Editor/Terrain/Circle Brush Material.flax
#	Content/Editor/Terrain/Highlight Terrain Material.flax
#	Content/Editor/TexturePreviewMaterial.flax
#	Content/Editor/Wires Debug Material.flax
#	Content/Engine/DefaultDeformableMaterial.flax
#	Content/Engine/DefaultMaterial.flax
#	Content/Engine/DefaultTerrainMaterial.flax
#	Content/Engine/SingleColorMaterial.flax
#	Content/Engine/SkyboxMaterial.flax
#	Source/Engine/Graphics/Materials/MaterialShader.h
This commit is contained in:
Wojtek Figat
2024-04-23 10:30:01 +02:00
91 changed files with 1107 additions and 830 deletions

View File

@@ -1281,8 +1281,8 @@ namespace FlaxEngine
/// <returns>The position snapped to the grid.</returns>
public static Float2 SnapToGrid(Float2 pos, Float2 gridSize)
{
pos.X = Mathf.Ceil((pos.X - (gridSize.X * 0.5f)) / gridSize.Y) * gridSize.X;
pos.Y = Mathf.Ceil((pos.Y - (gridSize.Y * 0.5f)) / gridSize.X) * gridSize.Y;
pos.X = Mathf.Ceil((pos.X - (gridSize.X * 0.5f)) / gridSize.X) * gridSize.X;
pos.Y = Mathf.Ceil((pos.Y - (gridSize.Y * 0.5f)) / gridSize.Y) * gridSize.Y;
return pos;
}

View File

@@ -774,7 +774,7 @@ void Matrix::Transformation(const Float3& scalingCenter, const Quaternion& scali
result = Translation(-scalingCenter) * Transpose(sr) * Scaling(scaling) * sr * Translation(scalingCenter) * Translation(-rotationCenter) * RotationQuaternion(rotation) * Translation(rotationCenter) * Translation(translation);
}
void Matrix::Transformation2D(Float2& scalingCenter, float scalingRotation, const Float2& scaling, const Float2& rotationCenter, float rotation, const Float2& translation, Matrix& result)
void Matrix::Transformation2D(const Float2& scalingCenter, float scalingRotation, const Float2& scaling, const Float2& rotationCenter, float rotation, const Float2& translation, Matrix& result)
{
result = Translation((Float3)-scalingCenter) * RotationZ(-scalingRotation) * Scaling((Float3)scaling) * RotationZ(scalingRotation) * Translation((Float3)scalingCenter) * Translation((Float3)-rotationCenter) * RotationZ(rotation) * Translation((Float3)rotationCenter) * Translation((Float3)translation);
result.M33 = 1.0f;

View File

@@ -941,7 +941,7 @@ public:
// @param rotation The rotation of the transformation.
// @param translation The translation factor of the transformation.
// @param result When the method completes, contains the created transformation matrix.
static void Transformation2D(Float2& scalingCenter, float scalingRotation, const Float2& scaling, const Float2& rotationCenter, float rotation, const Float2& translation, Matrix& result);
static void Transformation2D(const Float2& scalingCenter, float scalingRotation, const Float2& scaling, const Float2& rotationCenter, float rotation, const Float2& translation, Matrix& result);
// Creates a world matrix with the specified parameters.
// @param position Position of the object. This value is used in translation operations.

View File

@@ -99,7 +99,7 @@ Rectangle Rectangle::FromPoints(const Float2& p1, const Float2& p2)
return Rectangle(upperLeft, Math::Max(rightBottom - upperLeft, Float2::Zero));
}
Rectangle Rectangle::FromPoints(Float2* points, int32 pointsCount)
Rectangle Rectangle::FromPoints(const Float2* points, int32 pointsCount)
{
ASSERT(pointsCount > 0);
Float2 upperLeft = points[0];

View File

@@ -287,7 +287,7 @@ public:
// @returns Rectangle that contains both p1 and p2
static Rectangle FromPoints(const Float2& p1, const Float2& p2);
static Rectangle FromPoints(Float2* points, int32 pointsCount);
static Rectangle FromPoints(const Float2* points, int32 pointsCount);
};
template<>

View File

@@ -320,7 +320,7 @@ public:
/// </summary>
/// <param name="data">The data.</param>
/// <param name="length">The length.</param>
void Append(T* data, int32 length)
void Append(const T* data, int32 length)
{
if (length <= 0)
return;

View File

@@ -112,7 +112,7 @@ VariantType::VariantType(Types type, const StringAnsiView& typeName)
}
}
VariantType::VariantType(Types type, MClass* klass)
VariantType::VariantType(Types type, const MClass* klass)
{
Type = type;
TypeName = nullptr;

View File

@@ -105,7 +105,7 @@ public:
explicit VariantType(Types type, const StringView& typeName);
explicit VariantType(Types type, const StringAnsiView& typeName);
explicit VariantType(Types type, MClass* klass);
explicit VariantType(Types type, const MClass* klass);
explicit VariantType(const StringAnsiView& typeName);
VariantType(const VariantType& other);
VariantType(VariantType&& other) noexcept;