diff options
Diffstat (limited to 'Assets/Scripts/Utils/TransformUtility.cs')
-rw-r--r-- | Assets/Scripts/Utils/TransformUtility.cs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/Assets/Scripts/Utils/TransformUtility.cs b/Assets/Scripts/Utils/TransformUtility.cs deleted file mode 100644 index 62a28ece..00000000 --- a/Assets/Scripts/Utils/TransformUtility.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public static class TransformUtility -{ - - public static Matrix4x4 GetLocalToWorldMatrix(Transform transform) - { - Matrix4x4 mat = Matrix4x4.identity; - while(transform != null) - { - Matrix4x4 m = Matrix4x4.identity; - m.SetTRS2(transform.localPosition, transform.localRotation, transform.localScale); - mat = m * mat; - transform = transform.parent; - } - - return mat; - } - - public static Matrix4x4 GetLocalToWorldMatrixNoScale(Transform transform) - { - Matrix4x4 mat = Matrix4x4.identity; - while (transform != null) - { - Matrix4x4 m = Matrix4x4.identity; - m.SetTR(transform.localPosition, transform.localRotation); - mat = m * mat; - transform = transform.parent; - } - - return mat; - } - - public static Matrix4x4 GetLocalToWorldMatrixRootBone(Transform transform) - { - //Matrix4x4 mat = Matrix4x4.identity; - //while (transform != null) - //{ - // Matrix4x4 m = Matrix4x4.identity; - // m = Matrix4x4.Rotate(transform.localRotation); - // mat = m * mat; - // transform = transform.parent; - //} - //mat.SetColumn(3, new Vector4(trans.position.x, trans.position.y, trans.position.z, 1)); - - Matrix4x4 mat = Matrix4x4.Rotate(transform.rotation); - mat.SetColumn(3, new Vector4(transform.position.x, transform.position.y, transform.position.z, 1)); - - return mat; - } - -}
\ No newline at end of file |