private void RotateAxis(int index, int sign, bool newlyPressed, int frameDt)
        {
            float angleDelta = frameDt * BLOCK_ROTATION_SPEED;

            if (MyInput.Static.IsAnyCtrlKeyPressed())
            {
                if (!newlyPressed)
                {
                    return;
                }
                angleDelta = MathHelper.PiOver2;
            }
            if (MyInput.Static.IsAnyAltKeyPressed())
            {
                if (!newlyPressed)
                {
                    return;
                }
                angleDelta = MathHelper.ToRadians(1);
            }

            if (m_clipboard.IsActive)
            {
                m_clipboard.RotateAroundAxis(index, sign, newlyPressed, angleDelta);
            }
            if (m_floatingObjectClipboard.IsActive)
            {
                m_floatingObjectClipboard.RotateAroundAxis(index, sign, newlyPressed, angleDelta);
            }
        }
예제 #2
0
 private void SetRotation(MyGridClipboard clipboard, Vector3I rotation)
 {
     clipboard.RotateAroundAxis(0, System.Math.Sign(rotation.X), true, System.Math.Abs(rotation.X * MathHelper.PiOver2));
     clipboard.RotateAroundAxis(1, System.Math.Sign(rotation.Y), true, System.Math.Abs(rotation.Y * MathHelper.PiOver2));
     clipboard.RotateAroundAxis(2, System.Math.Sign(rotation.Z), true, System.Math.Abs(rotation.Z * MathHelper.PiOver2));
 }