コード例 #1
0
        static NSString SemanticToToken(SCNGeometrySourceSemantics geometrySourceSemantic)
        {
            switch (geometrySourceSemantic)
            {
            case SCNGeometrySourceSemantics.Vertex:
                return(SCNGeometrySourceSemantic.Vertex);

            case SCNGeometrySourceSemantics.Normal:
                return(SCNGeometrySourceSemantic.Normal);

            case SCNGeometrySourceSemantics.Color:
                return(SCNGeometrySourceSemantic.Color);

            case SCNGeometrySourceSemantics.Texcoord:
                return(SCNGeometrySourceSemantic.Texcoord);

            case SCNGeometrySourceSemantics.VertexCrease:
                return(SCNGeometrySourceSemantic.VertexCrease);

            case SCNGeometrySourceSemantics.EdgeCrease:
                return(SCNGeometrySourceSemantic.EdgeCrease);

            case SCNGeometrySourceSemantics.BoneWeights:
                return(SCNGeometrySourceSemantic.BoneWeights);

            case SCNGeometrySourceSemantics.BoneIndices:
                return(SCNGeometrySourceSemantic.BoneIndices);

            default:
                throw new System.ArgumentException("geometrySourceSemantic");
            }
        }
コード例 #2
0
        private bool isValidEnumForPlatform(SCNGeometrySourceSemantics value)
        {
            if (Asserts.IsAtLeastYosemite)
            {
                return(true);
            }

            switch (value)
            {
            case SCNGeometrySourceSemantics.Color:
            case SCNGeometrySourceSemantics.Normal:
            case SCNGeometrySourceSemantics.Texcoord:
            case SCNGeometrySourceSemantics.Vertex:
                return(true);

            case SCNGeometrySourceSemantics.BoneIndices:
            case SCNGeometrySourceSemantics.BoneWeights:
            case SCNGeometrySourceSemantics.EdgeCrease:
            case SCNGeometrySourceSemantics.VertexCrease:
            default:             // this might need updating with 10.11
                return(Asserts.IsAtLeastYosemite);
            }
        }
コード例 #3
0
 static NSString SemanticToToken(SCNGeometrySourceSemantics geometrySourceSemantic)
 {
     switch (geometrySourceSemantic) {
     case SCNGeometrySourceSemantics.Vertex:
         return SCNGeometrySourceSemantic.Vertex;
     case SCNGeometrySourceSemantics.Normal:
         return SCNGeometrySourceSemantic.Normal;
     case SCNGeometrySourceSemantics.Color:
         return SCNGeometrySourceSemantic.Color;
     case SCNGeometrySourceSemantics.Texcoord:
         return SCNGeometrySourceSemantic.Texcoord;
     case SCNGeometrySourceSemantics.VertexCrease:
         return SCNGeometrySourceSemantic.VertexCrease;
     case SCNGeometrySourceSemantics.EdgeCrease:
         return SCNGeometrySourceSemantic.EdgeCrease;
     case SCNGeometrySourceSemantics.BoneWeights:
         return SCNGeometrySourceSemantic.BoneWeights;
     case SCNGeometrySourceSemantics.BoneIndices:
         return SCNGeometrySourceSemantic.BoneIndices;
     default:
         throw new System.ArgumentException ("geometrySourceSemantic");
     }
 }
コード例 #4
0
 public static SCNGeometrySource FromMetalBuffer(IMTLBuffer mtlBuffer, MTLVertexFormat vertexFormat, SCNGeometrySourceSemantics semantic, nint vertexCount, nint offset, nint stride)
 {
     return(FromMetalBuffer(mtlBuffer, vertexFormat, SemanticToToken(semantic), vertexCount, offset, stride));
 }
コード例 #5
0
 public static SCNGeometrySource FromData(NSData data, SCNGeometrySourceSemantics semantic, nint vectorCount, bool floatComponents, nint componentsPerVector, nint bytesPerComponent, nint offset, nint stride)
 {
     return(FromData(data, SemanticToToken(semantic), vectorCount, floatComponents, componentsPerVector, bytesPerComponent, offset, stride));
 }
コード例 #6
0
 public static SCNGeometrySource FromMetalBuffer(IMTLBuffer mtlBuffer, MTLVertexFormat vertexFormat, SCNGeometrySourceSemantics semantic, nint vertexCount, nint offset, nint stride)
 {
     return FromMetalBuffer (mtlBuffer, vertexFormat, SemanticToToken (semantic), vertexCount, offset, stride);
 }
コード例 #7
0
 public static SCNGeometrySource FromData(NSData data, SCNGeometrySourceSemantics semantic, nint vectorCount, bool floatComponents, nint componentsPerVector, nint bytesPerComponent, nint offset, nint stride)
 {
     return FromData (data, SemanticToToken (semantic), vectorCount, floatComponents, componentsPerVector, bytesPerComponent, offset, stride);
 }