Merge pull request #1588 from ousttrue/fix10/matrix_multiply_order

UnityEngine.Matrix4x4 は列ベクトル表現なので、root * parent * local の向きに乗算する必要がある…
This commit is contained in:
ousttrue
2022-03-16 13:38:30 +09:00
committed by GitHub

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();