Added two complex prefab tests (#5089)

* Added two complex prefab tests

* Fix compile error

* Added extra methods, fixed test failure

* Addressed PR commments

* More PR comments

* Fix space

* Fix ar error
This commit is contained in:
AMZN-AlexOteiza
2021-10-29 22:32:33 +01:00
committed by GitHub
parent de4658b16c
commit e871dff70e
9 changed files with 223 additions and 16 deletions
@@ -168,6 +168,11 @@ namespace AZ
//! Rotation modifiers
//! @{
//! Set the world rotation matrix using the composition of rotations around
//! the principle axes in the order of z-axis first and y-axis and then x-axis.
//! @param eulerRadianAngles A Vector3 denoting radian angles of the rotations around each principle axis.
virtual void SetWorldRotation([[maybe_unused]] const AZ::Vector3& eulerAnglesRadian) {}
//! Sets the entity's rotation in the world in quaternion notation.
//! The origin of the axes is the entity's position in world space.
//! @param quaternion A quaternion that represents the rotation to use for the entity.
@@ -323,6 +323,13 @@ namespace AzFramework
return localZ;
}
void TransformComponent::SetWorldRotation(const AZ::Vector3& eulerAnglesRadian)
{
AZ::Transform newWorldTransform = m_worldTM;
newWorldTransform.SetRotation(AZ::Quaternion::CreateFromEulerAnglesRadians(eulerAnglesRadian));
SetWorldTM(newWorldTransform);
}
void TransformComponent::SetWorldRotationQuaternion(const AZ::Quaternion& quaternion)
{
AZ::Transform newWorldTransform = m_worldTM;
@@ -108,6 +108,7 @@ namespace AzFramework
float GetLocalZ() override;
// Rotation modifiers
void SetWorldRotation(const AZ::Vector3& eulerAnglesRadian) override;
void SetWorldRotationQuaternion(const AZ::Quaternion& quaternion) override;
AZ::Vector3 GetWorldRotation() override;