From c6b53148c4a9c67a4da42e5a2f89735d17184950 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 16 Feb 2022 16:52:27 +0900 Subject: [PATCH] remove unused --- .../Runtime/Extensions/NumericsExtensions.cs | 45 ------------------- Assets/VRM10/Runtime/IO/UnityExtension.cs | 30 +------------ Assets/VRM10/vrmlib/Runtime/Node.cs | 17 ------- 3 files changed, 1 insertion(+), 91 deletions(-) diff --git a/Assets/UniGLTF/Runtime/Extensions/NumericsExtensions.cs b/Assets/UniGLTF/Runtime/Extensions/NumericsExtensions.cs index f2dcf0932..987ffe52f 100644 --- a/Assets/UniGLTF/Runtime/Extensions/NumericsExtensions.cs +++ b/Assets/UniGLTF/Runtime/Extensions/NumericsExtensions.cs @@ -108,50 +108,5 @@ namespace UniGLTF if (m.M32 != 0) return false; return true; } - - // /// - // /// 移動 z反転 - // /// 回転 z反転 - // /// 拡大 据え置き - // /// - // /// これでいいのか? - // /// - // public static Matrix4x4 ReverseZ(this Matrix4x4 m) - // { - // if (m.IsOnlyTranslation()) - // { - // var ret = m; - // // R, R, R, 0 - // // R, R, R, 0 - // // R, R, R, 0 - // // T, T, T, 1 - // ret.M43 = -ret.M43; - // return ret; - // } - // else - // { - // var (t, r, s) = m.Decompose(); - // return FromTRS(t.ReverseZ(), r.ReverseZ(), s); - // } - // } - - // public static Matrix4x4 ReverseX(this Matrix4x4 m) - // { - // if (m.IsOnlyTranslation()) - // { - // var ret = m; - // // R, R, R, 0 - // // R, R, R, 0 - // // R, R, R, 0 - // // T, T, T, 1 - // ret.M41 = -ret.M41; - // return ret; - // } - // else - // { - // var (t, r, s) = m.Decompose(); - // return FromTRS(t.ReverseX(), r.ReverseX(), s); - // } - // } } } diff --git a/Assets/VRM10/Runtime/IO/UnityExtension.cs b/Assets/VRM10/Runtime/IO/UnityExtension.cs index 7f4812fa3..2cb803a0b 100644 --- a/Assets/VRM10/Runtime/IO/UnityExtension.cs +++ b/Assets/VRM10/Runtime/IO/UnityExtension.cs @@ -1,45 +1,17 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using VrmLib; +using UnityEngine; namespace UniVRM10 { public static class UnityExtension { - // public static Vector3 ToUnityVector3(this System.Numerics.Vector3 value) - // { - // return new Vector3(value.x, value.y, value.z); - // } - public static float[] ToFloat3(this Vector3 value) { return new[] { value.x, value.y, value.z }; } - // public static Quaternion ToUnityQuaternion(this System.Numerics.Quaternion value) - // { - // return new Quaternion(value.x, value.y, value.z, value.w); - // } - public static float[] ToFloat4(this Quaternion value) { return new float[] { value.x, value.y, value.z, value.w }; } - - // public static System.Numerics.Vector2 ToNumericsVector2(this Vector2 value) - // { - // return new System.Numerics.Vector2(value.x, value.y); - // } - - // public static System.Numerics.Vector3 ToNumericsVector3(this Vector3 value) - // { - // return new System.Numerics.Vector3(value.x, value.y, value.z); - // } - - // public static System.Numerics.Quaternion ToNumericsQuaternion(this Quaternion value) - // { - // return new System.Numerics.Quaternion(value.x, value.y, value.z, value.w); - // } } } diff --git a/Assets/VRM10/vrmlib/Runtime/Node.cs b/Assets/VRM10/vrmlib/Runtime/Node.cs index f83d8ca97..a6d9a6155 100644 --- a/Assets/VRM10/vrmlib/Runtime/Node.cs +++ b/Assets/VRM10/vrmlib/Runtime/Node.cs @@ -83,14 +83,6 @@ namespace VrmLib { (LocalTranslationWithoutUpdate, LocalRotationWithoutUpdate, LocalScalingWithoutUpdate) = value.Decompose(); CalcWorldMatrix(Parent != null ? Parent.Matrix : Matrix4x4.identity, calcWorldMatrix); - // if (Matrix4x4.Decompose(value, out LocalScalingWithoutUpdate, out LocalRotationWithoutUpdate, out LocalTranslationWithoutUpdate)) - // { - // CalcWorldMatrix(Parent != null ? Parent.Matrix : Matrix4x4.identity, calcWorldMatrix); - // } - // else - // { - // throw new Exception($"fail to decompose matrix: {Name}"); - // } } Matrix4x4 m_matrix = Matrix4x4.identity; @@ -98,10 +90,6 @@ namespace VrmLib { get => m_matrix; } - // public void SetMatrixWithoutUpdate(Matrix4x4 m) - // { - // m_matrix = m; - // } public Quaternion Rotation { @@ -157,15 +145,10 @@ namespace VrmLib public void CalcWorldMatrix(Matrix4x4 parent, bool calcChildren = true) { var value = LocalMatrix * parent; - // if (value == m_matrix) return; m_matrix = value; RaiseMatrixUpdated(); - // if (float.IsNaN(m_matrix.M11)) - // { - // var a = 0; - // } if (calcChildren) { foreach (var child in Children)