This commit is contained in:
ousttrue 2021-05-17 17:44:38 +09:00
parent 253846698c
commit cc3568da14

View File

@ -36,5 +36,11 @@ namespace UniVRM10
public Matrix4x4 TRS(float s) => Matrix4x4.TRS(Translation, Rotation, new Vector3(s, s, s));
public static TR operator *(TR a, TR b) => new TR(a.Rotation * b.Rotation, a.Rotation * b.Translation + a.Translation);
public TR Inverse()
{
var inv = Quaternion.Inverse(Rotation);
return new TR(inv, inv * Translation);
}
}
}