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)); }
private void UpdateTransformMatrix(Transform3DComponent trans) { trans.TransformMatrix = trans.RotationMatrix * Matrix.CreateTranslation(trans.Position); }
public void Move(Transform3DComponent pos, Vector3 move) { pos.Position += Vector3.Transform(move, pos.RotationMatrix); }
public HasMovedMessage(Transform3DComponent comp) { Component = comp; }