Exemplo n.º 1
0
 public PlaneDescriptor(PlaneId planeId, PlaneQuadrantId planeQuadrant)
 {
     _id                   = planeId;
     _quadrant             = planeQuadrant;
     _firstAxisDescriptor  = PlaneIdHelper.GetFirstAxisDescriptor(planeId, planeQuadrant);
     _secondAxisDescriptor = PlaneIdHelper.GetSecondAxisDescriptor(planeId, planeQuadrant);
 }
Exemplo n.º 2
0
        public static Vector3 GetLocalAxis(this Transform transform, AxisDescriptor axisDesc)
        {
            Vector3 axis = transform.right;

            if (axisDesc.Index == 1)
            {
                axis = transform.up;
            }
            else if (axisDesc.Index == 2)
            {
                axis = transform.forward;
            }

            if (axisDesc.Sign == AxisSign.Negative)
            {
                axis = -axis;
            }
            return(axis);
        }