Esempio n. 1
0
 public static CubeLayerCriteria Get(Axis axis, AxisLandmark position)
 {
     return(new CubeLayerCriteria(
                axisToVectorComponentFunc(axis),
                axisToVector(axis),
                axisLandmarkToFloat(position),
                position, axis));
 }
Esempio n. 2
0
 private CubeLayerCriteria(Func <Vector3, float> getVectorComponent, Vector3 axisVector, float positionComponent, AxisLandmark landmark, Axis axis)
 {
     GetVectorComponent = getVectorComponent;
     AxisVector         = axisVector;
     PositionComponent  = positionComponent;
     Landmark           = landmark;
     Axis = axis;
 }
Esempio n. 3
0
        private static float axisLandmarkToFloat(AxisLandmark landmark)
        {
            switch (landmark)
            {
            case AxisLandmark.Min:
                return(-1);

            case AxisLandmark.Mid:
                return(0);

            case AxisLandmark.Max:
                return(1);

            default:
                throw new ArgumentException("Unexpected axis landmark: " + landmark);
            }
        }