예제 #1
0
 private void Rotate(Transform3DComponent trans, Vector3 rot)
 {
     trans.Rotation += rot;
     trans.Rotation = new Vector3(MathHelper.Clamp(trans.Rotation.X, -MathHelper.PiOver2 + 0.01f, MathHelper.PiOver2 - 0.01f), trans.Rotation.Y, trans.Rotation.Z);
     //trans.Rotation = new Vector3(MathHelper.WrapAngle(trans.Rotation.X + rot.X), MathHelper.WrapAngle(trans.Rotation.Y + rot.Y),
     //    MathHelper.WrapAngle(trans.Rotation.Z + rot.Z));
 }
예제 #2
0
 private void UpdateTransformMatrix(Transform3DComponent trans)
 {
     trans.TransformMatrix = trans.RotationMatrix * Matrix.CreateTranslation(trans.Position);
 }
예제 #3
0
 public void Move(Transform3DComponent pos, Vector3 move)
 {
     pos.Position += Vector3.Transform(move, pos.RotationMatrix);
 }
예제 #4
0
 public HasMovedMessage(Transform3DComponent comp)
 {
     Component = comp;
 }