コード例 #1
0
 public void ConvertToLocalSpace(TransformComponent parent)
 {
     Scale.Vector3 *= parent.WorldScale.Vector3;
     RotationEuler.Vector3 += parent.WorldRotationEuler.Vector3;
     Position.Vector3 = Vector3.TransformCoordinate(Position.Vector3, parent.World);
 }
コード例 #2
0
 public void ConvertToParentSpace(TransformComponent parent)
 {
     var invParentWorld = Matrix.Invert(parent.World);
     Scale.Vector3 /= parent.WorldScale.Vector3;
     RotationEuler.Vector3 -= parent.WorldRotationEuler.Vector3;
     Position.Vector3 = Vector3.TransformCoordinate(Position.Vector3, invParentWorld);
 }