public static CubeLayerCriteria Get(Axis axis, AxisLandmark position) { return(new CubeLayerCriteria( axisToVectorComponentFunc(axis), axisToVector(axis), axisLandmarkToFloat(position), position, axis)); }
private CubeLayerCriteria(Func <Vector3, float> getVectorComponent, Vector3 axisVector, float positionComponent, AxisLandmark landmark, Axis axis) { GetVectorComponent = getVectorComponent; AxisVector = axisVector; PositionComponent = positionComponent; Landmark = landmark; Axis = axis; }
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); } }