public PlaneDescriptor(PlaneId planeId, PlaneQuadrantId planeQuadrant) { _id = planeId; _quadrant = planeQuadrant; _firstAxisDescriptor = PlaneIdHelper.GetFirstAxisDescriptor(planeId, planeQuadrant); _secondAxisDescriptor = PlaneIdHelper.GetSecondAxisDescriptor(planeId, planeQuadrant); }
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); }