adding support for non-uniform scale for decals

This commit is contained in:
greerdv
2021-04-29 11:46:08 +01:00
parent 409489e938
commit d35adce246
7 changed files with 44 additions and 8 deletions
@@ -262,7 +262,7 @@ namespace AZ
}
}
void DecalFeatureProcessor::SetDecalTransform(DecalHandle handle, const AZ::Transform& world)
void DecalFeatureProcessor::SetDecalTransform(DecalHandle handle, const AZ::Transform& world, const AZ::Vector3& nonUniformScale)
{
// https://jira.agscollab.com/browse/ATOM-4330
// Original Open 3D Engine uploads a 4x4 matrix rather than quaternion, rotation, scale.
@@ -274,7 +274,7 @@ namespace AZ
if (handle.IsValid())
{
Quaternion orientation = world.GetRotation();
Vector3 scale = world.GetScale();
Vector3 scale = world.GetScale() * nonUniformScale;
SetDecalHalfSize(handle, scale);
SetDecalPosition(handle, world.GetTranslation());