first pass of changing transform to use float for scale internally rather than Vector3

This commit is contained in:
greerdv
2021-04-27 18:12:46 +01:00
parent 540f0dcd98
commit b113f09a71
76 changed files with 487 additions and 546 deletions
@@ -58,19 +58,9 @@ namespace Camera
float axisPolarity = m_shouldInvertAxis ? -1.0f : 1.0f;
float rotationAmount = axisPolarity * m_rotationAmount;
// remove translation and scale
AZ::Vector3 translation = outLookAtTargetTransform.GetTranslation();
outLookAtTargetTransform.SetTranslation(AZ::Vector3::CreateZero());
AZ::Vector3 transformScale = outLookAtTargetTransform.ExtractScale();
// perform our rotation
AZ::Transform desiredRotationTransform = AZ::Transform::CreateFromQuaternion(AZ::Quaternion::CreateFromAxisAngle(outLookAtTargetTransform.GetBasis(m_axisOfRotation), rotationAmount));
outLookAtTargetTransform = desiredRotationTransform * outLookAtTargetTransform;
// return scale and translate
outLookAtTargetTransform.SetScale(transformScale);
outLookAtTargetTransform.SetTranslation(translation);
AZ::Quaternion desiredRotation = AZ::Quaternion::CreateFromAxisAngle(
outLookAtTargetTransform.GetBasis(m_axisOfRotation), rotationAmount);
outLookAtTargetTransform.SetRotation(desiredRotation * outLookAtTargetTransform.GetRotation());
}
void RotateCameraLookAt::Activate(AZ::EntityId entityId)