Ejemplo n.º 1
0
 /// <summary>
 /// Checks if the axis given in the parameter is in the axis set.
 /// e.g. if xy is set then it will return true for x but false for z
 /// </summary>
 /// <param name="axis">The axis.</param>
 /// <returns><c>true</c> if axis is set, <c>false</c> otherwise.</returns>
 public bool checkAxis(rotationAxis axis)
 {
     if ((axis & RotAxis) == axis)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
        private void changeRotationAxis(rotationAxis axis)
        {
            switch (axis)
            {
            case rotationAxis.X:
                RotationAxis = Vector3.right;
                break;

            case rotationAxis.Y:
                RotationAxis = Vector3.up;
                break;

            case rotationAxis.Z:
                RotationAxis = Vector3.forward;
                break;

            case rotationAxis.XY:
                RotationAxis = Vector3.right + Vector3.up;
                break;

            case rotationAxis.XYZ:
                RotationAxis = Vector3.right + Vector3.up + Vector3.forward;
                break;

            case rotationAxis.XZ:
                RotationAxis = Vector3.right + Vector3.forward;
                break;

            case rotationAxis.YZ:
                RotationAxis = Vector3.up + Vector3.forward;
                break;

            case rotationAxis.NONE:
                goto default;

            default:
                RotationAxis = Vector3.zero;
                break;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes an axis from the rotation set.
 /// e.g. if XY is the current axis and you use the parameter rotationAxis.Y then it will be rotationAxis.X
 /// </summary>
 /// <param name="axis">The axis.</param>
 public void removeAxis(rotationAxis axis)
 {
     RotAxis = RotAxis & ~axis;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Adds an axis to the rotation set.
 /// e.g. if X is the current axis and you use the parameter rotationAxis.Y then it will be rotationAxis.XY
 /// </summary>
 /// <param name="axis">The axis.</param>
 public void addAxis(rotationAxis axis)
 {
     RotAxis = RotAxis | axis;
 }