Pārlūkot izejas kodu

Remove some math functions from AzCoreConversions.h in favor of using AzMath directly (#18763)

* Remove some math functions from AzCoreConversions.h in favor of using AzMath directly.

Replaced math functions:
 * MCore::AzQuaternionToEulerAngles -> AZ::Quaternion::GetEulerRadiansZYX
 * MCore::ToAxisAngle -> AZ::Quaternion::ConvertToAxisAngle
 * MCore::AzEulerAnglesToAzQuat -> AZ::Quaternion::CreateFromEulerRadiansZYX
 * MCore::NLerp -> AZ::Quaternion::NLerp
 * MCore::CreateFromQuaternionAndTranslationAndScale -> AZ::Transform::Transform
 * MCore::EmfxTransformToAzTransform -> EMotionFX::Transform::ToAZTransform
 * MCore::AzTransformToEmfxTransform -> EMotionFX::Transform::Transform

Removed AZCoreConversionsTest.cpp since the functions being tested are removed.

Signed-off-by: Ross Charles Campbell <[email protected]>

* Fix the conversion of AZ::Quaternion::CreateFromAxisAngle()

The function requires the axis to be normalized.

Signed-off-by: Ross Charles C. <[email protected]>

* Fix build error

Also successfully ran the unit test (AzTestRunner.exe EMotionFX.Tests.dll AzRunUnitTests)

Signed-off-by: Ross Charles Campbell <[email protected]>

---------

Signed-off-by: Ross Charles Campbell <[email protected]>
Signed-off-by: Ross Charles C. <[email protected]>
Ross Charles C. 4 mēneši atpakaļ
vecāks
revīzija
cc1c365311

+ 1 - 2
Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp

@@ -24,7 +24,6 @@
 #include <EMotionFX/Source/Skeleton.h>
 #include <EMotionFX/Source/Mesh.h>
 #include <EMotionFX/Source/Node.h>
-#include <MCore/Source/AzCoreConversions.h>
 
 #include <Atom/RHI/RHIUtils.h>
 
@@ -454,7 +453,7 @@ namespace AZ::Render
         const EMotionFX::TransformData* transforms = m_actorInstance->GetTransformData();
         if (transforms && jointIndex < transforms->GetNumTransforms())
         {
-            return MCore::EmfxTransformToAzTransform(transforms->GetCurrentPose()->GetModelSpaceTransform(jointIndex));
+            return transforms->GetCurrentPose()->GetModelSpaceTransform(jointIndex).ToAZTransform();
         }
 
         return AZ::Transform::CreateIdentity();

+ 1 - 1
Gems/EMotionFX/Code/EMotionFX/Exporters/ExporterLib/Exporter/NodeExport.cpp

@@ -98,7 +98,7 @@ namespace ExporterLib
         MCore::LogDetailedInfo("    + NumChilds: %i", nodeChunk.m_numChilds);
         MCore::LogDetailedInfo("    + Position: x=%f y=%f z=%f", nodeChunk.m_localPos.m_x, nodeChunk.m_localPos.m_y, nodeChunk.m_localPos.m_z);
         MCore::LogDetailedInfo("    + Rotation: x=%f y=%f z=%f w=%f", nodeChunk.m_localQuat.m_x, nodeChunk.m_localQuat.m_y, nodeChunk.m_localQuat.m_z, nodeChunk.m_localQuat.m_w);
-        const AZ::Vector3 euler = MCore::AzQuaternionToEulerAngles(rotation);
+        const AZ::Vector3 euler = rotation.GetEulerRadiansZYX();
         MCore::LogDetailedInfo("    + Rotation Euler: x=%f y=%f z=%f",
             float(euler.GetX()) * 180.0 / MCore::Math::pi,
             float(euler.GetY()) * 180.0 / MCore::Math::pi,

+ 1 - 1
Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp

@@ -1476,7 +1476,7 @@ namespace EMotionFX
             Transform localTransform = pose.GetLocalSpaceTransform(motionSource);
             Transform orgDelta = Transform::CreateIdentity();
             orgDelta.m_position.Set(1.1f, 2.2f, 3.3f);
-            orgDelta.m_rotation = MCore::AzEulerAnglesToAzQuat(0.1f, 0.2f, 0.3f);
+            orgDelta.m_rotation = AZ::Quaternion::CreateFromEulerRadiansZYX(AZ::Vector3(0.1f, 0.2f, 0.3f));
             Transform delta = orgDelta;
             delta.Multiply(localTransform);
             pose.SetLocalSpaceTransform(motionSource, delta);

+ 1 - 1
Gems/EMotionFX/Code/EMotionFX/Source/KeyTrackLinearDynamic.inl

@@ -315,7 +315,7 @@ namespace EMotionFX
         const float t = (currentTime - firstKey.GetTime()) / (nextKey.GetTime() - firstKey.GetTime());
 
         // lerp between them
-        return MCore::NLerp(firstKey.GetValue(), nextKey.GetValue(), t);
+        return firstKey.GetValue().NLerp(nextKey.GetValue(), t);
     }
 
 

+ 4 - 6
Gems/EMotionFX/Code/EMotionFX/Source/Transform.cpp

@@ -196,8 +196,7 @@ namespace EMotionFX
         AZ::Transform result;
 
     #ifndef EMFX_SCALE_DISABLED
-        result = MCore::CreateFromQuaternionAndTranslationAndScale(m_rotation, m_position, m_scale);
-
+        result = AZ::Transform(m_position, m_rotation, m_scale.GetMaxElement());
     #else
         result = AZ::Transform::CreateFromQuaternionAndTranslation(m_rotation, m_position);
     #endif
@@ -529,8 +528,7 @@ namespace EMotionFX
     Transform& Transform::Blend(const Transform& dest, float weight)
     {
         m_position = m_position.Lerp(dest.m_position, weight);
-        m_rotation = MCore::NLerp(m_rotation, dest.m_rotation, weight);
-
+        m_rotation = m_rotation.NLerp(dest.m_rotation, weight);
         EMFX_SCALECODE
         (
             m_scale = m_scale.Lerp(dest.m_scale, weight);
@@ -545,7 +543,7 @@ namespace EMotionFX
     {
         const AZ::Vector3    relPos      = dest.m_position - orgTransform.m_position;
         const AZ::Quaternion& orgRot     = orgTransform.m_rotation;
-        const AZ::Quaternion rot         = MCore::NLerp(orgRot, dest.m_rotation, weight);
+        const AZ::Quaternion rot         = orgRot.NLerp(dest.m_rotation, weight);
 
         // apply the relative changes
         m_rotation = m_rotation * (orgRot.GetConjugate() * rot);
@@ -578,7 +576,7 @@ namespace EMotionFX
     Transform& Transform::ApplyAdditive(const Transform& additive, float weight)
     {
         m_position += additive.m_position * weight;
-        m_rotation = MCore::NLerp(m_rotation, m_rotation * additive.m_rotation, weight);
+        m_rotation = m_rotation.NLerp(m_rotation * additive.m_rotation, weight);
         EMFX_SCALECODE
         (
             m_scale *= AZ::Vector3::CreateOne().Lerp(additive.m_scale, weight);

+ 1 - 1
Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/NodeGraph.cpp

@@ -385,7 +385,7 @@ namespace EMStudio
                     case MCore::AttributeQuaternion::TYPE_ID:
                     {
                         MCore::AttributeQuaternion* quatAttribute = static_cast<MCore::AttributeQuaternion*>(attribute);
-                        const AZ::Vector3 eulerAngles = MCore::AzQuaternionToEulerAngles(quatAttribute->GetValue());
+                        const AZ::Vector3 eulerAngles = quatAttribute->GetValue().GetEulerRadiansZYX();
                         m_tempStringA = AZStd::string::format("(%.2f, %.2f, %.2f)", static_cast<float>(eulerAngles.GetX()), static_cast<float>(eulerAngles.GetY()), static_cast<float>(eulerAngles.GetZ()));
                         break;
                     }

+ 3 - 248
Gems/EMotionFX/Code/MCore/Source/AzCoreConversions.h

@@ -26,185 +26,6 @@
 
 namespace MCore
 {
-    AZ_FORCE_INLINE AZ::Transform EmfxTransformToAzTransform(const EMotionFX::Transform& emfxTransform)
-    {
-        AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation(emfxTransform.m_rotation, emfxTransform.m_position);
-        EMFX_SCALECODE
-        (
-            transform.MultiplyByUniformScale(emfxTransform.m_scale.GetMaxElement());
-        )
-        return transform;
-    }
-
-    AZ_FORCE_INLINE EMotionFX::Transform AzTransformToEmfxTransform(const AZ::Transform& azTransform)
-    {
-        return EMotionFX::Transform(azTransform);
-    }
-
-    // O3DE_DEPRECATION_NOTICE(GHI-10471)
-    //! @deprecated AZ::Quaternion::CreateFromAxisAngle where the axis is normalized should be equivelent to MCore::CreateFromAxisAndAngle
-    AZ_FORCE_INLINE AZ::Quaternion CreateFromAxisAndAngle(const AZ::Vector3& axis, const float angle)
-    {
-        const float squaredLength = axis.GetLengthSq();
-        if (squaredLength > 0.0f)
-        {
-            const float halfAngle = angle * 0.5f;
-            const float sinScale = Math::Sin(halfAngle) / Math::Sqrt(squaredLength);
-            return AZ::Quaternion(axis.GetX() * sinScale,
-                axis.GetY() * sinScale,
-                axis.GetZ() * sinScale,
-                Math::Cos(halfAngle));
-        }
-        else
-        {
-            return AZ::Quaternion::CreateIdentity();
-        }
-    }
-
-    //! O3DE_DEPRECATION_NOTICE(GHI-10508)
-    //! @deprecated use AZ::Quaternion::CreateFromEulerRadiansZYX
-    AZ_FORCE_INLINE AZ::Quaternion AzEulerAnglesToAzQuat(float pitch, float yaw, float roll)
-    {
-        // In the LY coordinate system, pitch: X, yaw: Z, roll: Y.
-        const float halfYaw = yaw * 0.5f;
-        const float halfPitch = pitch * 0.5f;
-        const float halfRoll = roll * 0.5f;
-
-        const float cY = Math::Cos(halfYaw);
-        const float sY = Math::Sin(halfYaw);
-        const float cP = Math::Cos(halfPitch);
-        const float sP = Math::Sin(halfPitch);
-        const float cR = Math::Cos(halfRoll);
-        const float sR = Math::Sin(halfRoll);
-
-        // Method 1:
-        return AZ::Quaternion(
-            cY * sP * cR - sY * cP * sR,
-            cY * sP * sR + sY * cP * cR,
-            cY * cP * sR - sY * sP * cR,
-            cY * cP * cR + sY * sP * sR
-        );
-
-        // Method 2:
-        /*const AZ::Quaternion Qx = MCore::CreateFromAxisAndAngle(AZ::Vector3(sP, 0, 0), cP);
-        const AZ::Quaternion Qy = MCore::CreateFromAxisAndAngle(AZ::Vector3(0, sY, 0), cY);
-        const AZ::Quaternion Qz = MCore::CreateFromAxisAndAngle(AZ::Vector3(0, 0, sR), cR);
-
-        return Qx * Qy * Qz;*/
-
-        //  Normalize();    // we might be able to leave the normalize away, but better safe than not, this is more robust :)
-    }
-
-    AZ_FORCE_INLINE AZ::Quaternion AzEulerAnglesToAzQuat(const AZ::Vector3& eulerAngles)
-    {
-        return AzEulerAnglesToAzQuat(eulerAngles.GetX(), eulerAngles.GetY(), eulerAngles.GetZ());
-    }
-
-    AZ_FORCE_INLINE AZ::Vector3 AzQuaternionToEulerAngles(const AZ::Quaternion& q)
-    {
-        /*
-            // METHOD #1:
-
-            Vector3 euler;
-
-            float matrix[3][3];
-            float cx,sx;
-            float cy,sy,yr;
-            float cz,sz;
-
-            matrix[0][0] = 1.0 - (2.0 * y * y) - (2.0 * z * z);
-            matrix[1][0] = (2.0 * x * y) + (2.0 * w * z);
-            matrix[2][0] = (2.0 * x * z) - (2.0 * w * y);
-            matrix[2][1] = (2.0 * y * z) + (2.0 * w * x);
-            matrix[2][2] = 1.0 - (2.0 * x * x) - (2.0 * y * y);
-
-            sy = -matrix[2][0];
-            cy = Math::Sqrt(1 - (sy * sy));
-            yr = Math::ATan2(sy,cy);
-            euler.y = yr;
-
-            // avoid divide by zero only where y ~90 or ~270
-            if (sy != 1.0 && sy != -1.0)
-            {
-                cx = matrix[2][2] / cy;
-                sx = matrix[2][1] / cy;
-                euler.x = Math::ATan2(sx,cx);
-
-                cz = matrix[0][0] / cy;
-                sz = matrix[1][0] / cy;
-                euler.z = Math::ATan2(sz,cz);
-            }
-            else
-            {
-                matrix[1][1] = 1.0 - (2.0 * x * x) - (2.0 * z * z);
-                matrix[1][2] = (2.0 * y * z) - (2.0 * w * x);
-                cx = matrix[1][1];
-                sx = -matrix[1][2];
-                euler.x = Math::ATan2(sx,cx);
-
-                cz = 1.0;
-                sz = 0.0;
-                euler.z = Math::ATan2(sz,cz);
-            }
-
-            return euler;
-        */
-
-        /*
-            // METHOD #2:
-            Matrix mat = ToMatrix();
-
-            //
-            float cy = Math::Sqrt(mat.m44[0][0]*mat.m44[0][0] + mat.m44[0][1]*mat.m44[0][1]);
-            if (cy > 16.0*Math::epsilon)
-            {
-                result.x = -atan2(mat.m44[1][2], mat.m44[2][2]);
-                result.y = -atan2(-mat.m44[0][2], cy);
-                result.z = -atan2(mat.m44[0][1], mat.m44[0][0]);
-            }
-            else
-            {
-                result.x = -atan2(-mat.m44[2][1], mat.m44[1][1]);
-                result.y = -atan2(-mat.m44[0][2], cy);
-                result.z = 0.0;
-            }
-
-            return result;
-        */
-
-        // METHOD #3 (without conversion to matrix first):
-        // TODO: safety checks?
-        float m00 = 1.0f - (2.0f * ((q.GetY() * q.GetY()) + q.GetZ() * q.GetZ()));
-        float m01 = 2.0f * (q.GetX() * q.GetY() + q.GetW() * q.GetZ());
-
-        AZ::Vector3 result(
-            Math::ATan2(2.0f * (q.GetY() * q.GetZ() + q.GetW() * q.GetX()), 1.0f - (2.0f * ((q.GetX() * q.GetX()) + (q.GetY() * q.GetY())))),
-            Math::ATan2(-2.0f * (q.GetX() * q.GetZ() - q.GetW() * q.GetY()), Math::Sqrt((m00 * m00) + (m01 * m01))),
-            Math::ATan2(m01, m00)
-        );
-
-        return result;
-    }
-
-    AZ_FORCE_INLINE AZ::Quaternion NLerp(const AZ::Quaternion& left, const AZ::Quaternion& right, float t)
-    {
-        const float omt = 1.0f - t;
-        const float dot = left.Dot(right);
-        if (dot < 0.0f)
-        {
-            t = -t;
-        }
-
-        // calculate the interpolated values
-        const AZ::Quaternion newQuat = omt * left + t * right;
-
-        // calculate the inverse length
-        const float invLen = Math::InvSqrt(newQuat.Dot(newQuat));
-
-        // return the normalized linear interpolation
-        return invLen * newQuat;
-    }
-
     AZ_FORCE_INLINE AZ::Vector3 CalcUpAxis(const AZ::Quaternion& q)
     {
         // TODO: make it more vector friendly, something like this:
@@ -239,24 +60,6 @@ namespace MCore
             2.0f * q.GetY() * q.GetZ() + 2.0f * q.GetX() * q.GetW());
     }
 
-    // TODO: replace in favor of AzFramework::ConvertQuaternionToAxisAngle
-    AZ_FORCE_INLINE void ToAxisAngle(const AZ::Quaternion& q, AZ::Vector3& axis, float& angle)
-    {
-        angle = 2.0f * Math::ACos(q.GetW());
-
-        const float sinHalfAngle = Math::Sin(angle * 0.5f);
-        if (sinHalfAngle > 0.0f)
-        {
-            const float invS = 1.0f / sinHalfAngle;
-            axis.Set(q.GetX() * invS, q.GetY() * invS, q.GetZ() * invS);
-        }
-        else
-        {
-            axis.Set(0.0f, 1.0f, 0.0f);
-            angle = 0.0f;
-        }
-    }
-
     AZ_FORCE_INLINE float GetEulerZ(const AZ::Quaternion& q)
     {
         float m00 = 1.0f - (2.0f * ((q.GetY() * q.GetY()) + q.GetZ() * q.GetZ()));
@@ -270,8 +73,9 @@ namespace MCore
         if (dot < 0.99999f) // we have rotated compared to the forward direction
         {
             const float angleRadians = Math::ACos(dot);
-            const AZ::Vector3 rotAxis = fromVector.Cross(toVector);
-            return CreateFromAxisAndAngle(rotAxis, angleRadians);
+            AZ::Vector3 rotAxis = fromVector.Cross(toVector);
+            rotAxis.Normalize();
+            return AZ::Quaternion::CreateFromAxisAngle(rotAxis, angleRadians);
         }
         else
         {
@@ -356,15 +160,6 @@ namespace MCore
         return matrix;
     }
 
-    AZ_FORCE_INLINE AZ::Transform CreateFromQuaternionAndTranslationAndScale(const AZ::Quaternion& rotation, const AZ::Vector3& translation, const AZ::Vector3& scale)
-    {
-        AZ::Transform result;
-        result.SetTranslation(translation);
-        result.SetRotation(rotation);
-        result.SetUniformScale(scale.GetMaxElement());
-        return result;
-    }
-
     AZ_FORCE_INLINE AZ::Transform GetRotationMatrixAxisAngle(const AZ::Vector3& axis, float angle)
     {
         const float length2 = axis.GetLengthSq();
@@ -455,46 +250,6 @@ namespace MCore
         //  (l+right)/(l-right)  (top+bottom)/(bottom-top)  znearPlane/(znearPlane-zfarPlane)  1
     }
 
-    AZ_FORCE_INLINE AZ::Vector3 GetRight(const AZ::Matrix4x4& mat)
-    {
-        return mat.GetColumnAsVector3(0);
-    }
-
-    AZ_FORCE_INLINE AZ::Vector3 GetForward(const AZ::Matrix4x4& mat)
-    {
-        return mat.GetColumnAsVector3(1);
-    }
-
-    AZ_FORCE_INLINE AZ::Vector3 GetUp(const AZ::Matrix4x4& mat)
-    {
-        return mat.GetColumnAsVector3(2);
-    }
-
-    AZ_FORCE_INLINE AZ::Vector3 GetTranslation(const AZ::Matrix4x4& mat)
-    {
-        return mat.GetColumnAsVector3(3);
-    }
-
-    AZ_FORCE_INLINE AZ::Vector3 GetRight(const AZ::Transform& mat)
-    {
-        return mat.GetBasisX();
-    }
-
-    AZ_FORCE_INLINE AZ::Vector3 GetForward(const AZ::Transform& mat)
-    {
-        return mat.GetBasisY();
-    }
-
-    AZ_FORCE_INLINE AZ::Vector3 GetUp(const AZ::Transform& mat)
-    {
-        return mat.GetBasisZ();
-    }
-
-    AZ_FORCE_INLINE AZ::Vector3 GetTranslation(const AZ::Transform& mat)
-    {
-        return mat.GetTranslation();
-    }
-
     // MCore::Matrix was not doing a full invertion of the matrix, it was just inverting the 3x3 region and converting
     // the translation part. This method mimics what that inverse was doing
     AZ_FORCE_INLINE AZ::Matrix4x4 InvertProjectionMatrix(const AZ::Matrix4x4& mat)

+ 2 - 2
Gems/EMotionFX/Code/MCore/Source/Compare.inl

@@ -53,8 +53,8 @@ MCORE_INLINE bool Compare<AZ::Quaternion>::CheckIfIsClose(const AZ::Quaternion&
     float   angleA, angleB;
 
     // convert to an axis and angle representation
-    MCore::ToAxisAngle(a, axisA, angleA);
-    MCore::ToAxisAngle(b, axisB, angleB);
+    a.ConvertToAxisAngle(axisA, angleA);
+    b.ConvertToAxisAngle(axisB, angleB);
 
     // compare the axis and angles
     if (Math::Abs(angleA  - angleB) > threshold)

+ 3 - 5
Gems/EMotionFX/Code/Source/Integration/Components/ActorComponent.cpp

@@ -32,8 +32,6 @@
 #include <EMotionFX/Source/TransformData.h>
 #include <EMotionFX/Source/AttachmentNode.h>
 
-#include <MCore/Source/AzCoreConversions.h>
-
 #include <Atom/RPI.Reflect/Model/ModelAsset.h>
 
 namespace EMotionFX
@@ -796,17 +794,17 @@ namespace EMotionFX
             {
             case Space::LocalSpace:
             {
-                return MCore::EmfxTransformToAzTransform(currentPose->GetLocalSpaceTransform(index));
+                return currentPose->GetLocalSpaceTransform(index).ToAZTransform();
             }
 
             case Space::ModelSpace:
             {
-                return MCore::EmfxTransformToAzTransform(currentPose->GetModelSpaceTransform(index));
+                return currentPose->GetModelSpaceTransform(index).ToAZTransform();
             }
 
             case Space::WorldSpace:
             {
-                return MCore::EmfxTransformToAzTransform(currentPose->GetWorldSpaceTransform(index));
+                return currentPose->GetWorldSpaceTransform(index).ToAZTransform();
             }
 
             default:

+ 3 - 4
Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp

@@ -13,7 +13,6 @@
 #include <AzCore/RTTI/BehaviorContext.h>
 
 #include <MCore/Source/AttributeString.h>
-#include <MCore/Source/AzCoreConversions.h>
 #include <EMotionFX/Source/AnimGraph.h>
 #include <EMotionFX/Source/AnimGraphInstance.h>
 #include <EMotionFX/Source/ActorInstance.h>
@@ -824,7 +823,7 @@ namespace EMotionFX
                 {
                     MCore::AttributeQuaternion* quaternionParam = static_cast<MCore::AttributeQuaternion*>(param);
                     previousValue = quaternionParam->GetValue();
-                    quaternionParam->SetValue(MCore::AzEulerAnglesToAzQuat(value));
+                    quaternionParam->SetValue(AZ::Quaternion::CreateFromEulerRadiansZYX(value));
                     break;
                 }
                 default:
@@ -839,7 +838,7 @@ namespace EMotionFX
                     m_animGraphInstance.get(),
                     parameterIndex,
                     previousValue,
-                    MCore::AzEulerAnglesToAzQuat(value));
+                    AZ::Quaternion::CreateFromEulerRadiansZYX(value));
             }
         }
 
@@ -1108,7 +1107,7 @@ namespace EMotionFX
             {
                 AZ::Quaternion value;
                 m_animGraphInstance->GetRotationParameterValue(parameterIndex, &value);
-                return MCore::AzQuaternionToEulerAngles(value);
+                return value.GetEulerRadiansZYX();
             }
             return AZ::Vector3::CreateZero();
         }

+ 1 - 1
Gems/EMotionFX/Code/Source/Integration/Editor/Components/EditorActorComponent.cpp

@@ -669,7 +669,7 @@ namespace EMotionFX
                 return;
             }
 
-            m_actorInstance->SetLocalSpaceTransform(MCore::AzTransformToEmfxTransform(world));
+            m_actorInstance->SetLocalSpaceTransform(Transform(world));
         }
 
         //////////////////////////////////////////////////////////////////////////

+ 2 - 3
Gems/EMotionFX/Code/Tests/AnimGraphComponentBusTests.cpp

@@ -27,7 +27,6 @@
 #include <Integration/Components/ActorComponent.h>
 #include <Integration/Components/AnimGraphComponent.h>
 #include <MCore/Source/AttributeFloat.h>
-#include <MCore/Source/AzCoreConversions.h>
 #include <Tests/Integration/EntityComponentFixture.h>
 #include <Tests/TestAssetCode/AnimGraphFactory.h>
 #include <Tests/TestAssetCode/ActorFactory.h>
@@ -317,9 +316,9 @@ namespace EMotionFX
     TEST_F(AnimGraphComponentBusTests, RotationParameter)
     {
         const AZ::Vector3 firstExpected(AZ::DegToRad(30.0f), AZ::DegToRad(20.0f), 0.0f);
-        const AZ::Quaternion firstExpectedQuat = MCore::AzEulerAnglesToAzQuat(firstExpected);
+        const AZ::Quaternion firstExpectedQuat = AZ::Quaternion::CreateFromEulerRadiansZYX(firstExpected);
         const AZ::Vector3 secondExpected = AZ::Vector3(AZ::DegToRad(45.0f), 0.0f, AZ::DegToRad(30.0f));
-        const AZ::Quaternion secondExpectedQuat = MCore::AzEulerAnglesToAzQuat(secondExpected);
+        const AZ::Quaternion secondExpectedQuat = AZ::Quaternion::CreateFromEulerRadiansZYX(secondExpected);
 
 
         AnimGraphComponentNotificationTestBus testBus(m_entityId);

+ 0 - 62
Gems/EMotionFX/Code/Tests/MCore/AZCoreConversionsTest.cpp

@@ -1,62 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <AZTestShared/Math/MathTestHelpers.h>
-#include <AzCore/Math/Quaternion.h>
-#include <AzCore/Math/Vector3.h>
-#include <AzTest/AzTest.h>
-#include <MCore/Source/AzCoreConversions.h>
-
-namespace MCore
-{
-    struct EulerTestArgs {
-        AZ::Vector3 eular;
-        AZ::Quaternion result;
-    };
-    
-    using AngleRadianTestFixtureXYZ = ::testing::TestWithParam<EulerTestArgs>;
-
-    TEST_P(AngleRadianTestFixtureXYZ, AzEulerAnglesToAzQuat) {
-        auto& param = GetParam();
-        EXPECT_THAT(MCore::AzEulerAnglesToAzQuat(param.eular.GetX(),param.eular.GetY(),param.eular.GetZ()), UnitTest::IsClose(param.result));
-    }
-
-    // same test cases in QuaternionTests.cpp AngleRadianTestFixtureZYX
-    INSTANTIATE_TEST_SUITE_P(
-        MATH_AZCoreConversions,
-        AngleRadianTestFixtureXYZ,
-        ::testing::Values(
-            EulerTestArgs{ AZ::Vector3(AZ::Constants::QuarterPi, 0, 0), AZ::Quaternion::CreateRotationX(AZ::Constants::QuarterPi) },
-            EulerTestArgs{ AZ::Vector3(0, AZ::Constants::QuarterPi, 0), AZ::Quaternion::CreateRotationY(AZ::Constants::QuarterPi) },
-            EulerTestArgs{ AZ::Vector3(0, 0, AZ::Constants::QuarterPi), AZ::Quaternion::CreateRotationZ(AZ::Constants::QuarterPi) },
-
-            EulerTestArgs{ AZ::Vector3(-AZ::Constants::QuarterPi, 0, 0), AZ::Quaternion::CreateRotationX(-AZ::Constants::QuarterPi) },
-            EulerTestArgs{ AZ::Vector3(0, -AZ::Constants::QuarterPi, 0), AZ::Quaternion::CreateRotationY(-AZ::Constants::QuarterPi) },
-            EulerTestArgs{ AZ::Vector3(0, 0, -AZ::Constants::QuarterPi), AZ::Quaternion::CreateRotationZ(-AZ::Constants::QuarterPi) },
-
-            EulerTestArgs{ AZ::Vector3(AZ::Constants::QuarterPi,AZ::Constants::QuarterPi, 0), AZ::Quaternion::CreateRotationY(AZ::Constants::QuarterPi) *
-                AZ::Quaternion::CreateRotationX(AZ::Constants::QuarterPi) },
-            EulerTestArgs{ AZ::Vector3(0,AZ::Constants::QuarterPi,AZ::Constants::QuarterPi), AZ::Quaternion::CreateRotationZ(AZ::Constants::QuarterPi) *
-                AZ::Quaternion::CreateRotationY(AZ::Constants::QuarterPi) },
-            EulerTestArgs{ AZ::Vector3(AZ::Constants::QuarterPi, 0,AZ::Constants::QuarterPi), AZ::Quaternion::CreateRotationZ(AZ::Constants::QuarterPi) *
-                AZ::Quaternion::CreateRotationX(AZ::Constants::QuarterPi)},
-                
-            EulerTestArgs{ AZ::Vector3(AZ::Constants::HalfPi, 0,AZ::Constants::QuarterPi), 
-                AZ::Quaternion::CreateRotationZ(AZ::Constants::QuarterPi) *
-                AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi)},
-            EulerTestArgs{ AZ::Vector3(-AZ::Constants::QuarterPi, -AZ::Constants::HalfPi,AZ::Constants::QuarterPi), 
-                AZ::Quaternion::CreateRotationZ(AZ::Constants::QuarterPi) *
-                AZ::Quaternion::CreateRotationY(-AZ::Constants::HalfPi) *
-                AZ::Quaternion::CreateRotationX(-AZ::Constants::QuarterPi)},
-            EulerTestArgs{ AZ::Vector3(-AZ::Constants::QuarterPi,AZ::Constants::HalfPi,AZ::Constants::TwoOverPi), 
-                AZ::Quaternion::CreateRotationZ(AZ::Constants::TwoOverPi) *
-                AZ::Quaternion::CreateRotationY(AZ::Constants::HalfPi) *
-                AZ::Quaternion::CreateRotationX(-AZ::Constants::QuarterPi)}
-        ));
-
-} // namespace MCore

+ 0 - 1
Gems/EMotionFX/Code/emotionfx_tests_files.cmake

@@ -38,7 +38,6 @@ set(FILES
     Tests/AnimGraphParameterActionTests.cpp
     Tests/AnimGraphParameterActionTests.cpp
     Tests/AnimGraphParameterConditionCommandTests.cpp
-    Tests/MCore/AZCoreConversionsTest.cpp
     Tests/AnimGraphParameterConditionTests.cpp
     Tests/AnimGraphParameterConditionCommandTests.cpp
     Tests/AnimGraphRefCountTests.cpp