UnityEngine.Matrix4x4 は列ベクトル表現なので、root * parent * local の向きに乗算する必要がある(System.Numerics.Matrix4x4と逆)

This commit is contained in:
ousttrue
2022-03-16 13:06:52 +09:00
parent 1a20f83a93
commit efd1776932

View File

@@ -114,7 +114,7 @@ namespace VrmLib
{
if (Parent != null)
{
SetLocalMatrix(m * Parent.InverseMatrix, calcWorldMatrix);
SetLocalMatrix(Parent.InverseMatrix * m, calcWorldMatrix);
}
else
{
@@ -144,7 +144,7 @@ namespace VrmLib
public void CalcWorldMatrix(Matrix4x4 parent, bool calcChildren = true)
{
var value = LocalMatrix * parent;
var value = parent * LocalMatrix;
m_matrix = value;
RaiseMatrixUpdated();