示例#1
0
        public static MDLMesh CreateBox(Vector3 vector, Vector3i segments, MDLGeometryType geometryType, bool inwardNormals, IMDLMeshBufferAllocator allocator, MDLMeshVectorType type = MDLMeshVectorType.Dimensions)
        {
            switch (type)
            {
            case MDLMeshVectorType.Dimensions:
                return(NewBoxWithDimensions(vector, segments, geometryType, inwardNormals, allocator));

            case MDLMeshVectorType.Extent:
                return(new MDLMesh(vector, segments, inwardNormals, geometryType, allocator));

            default:
                throw new ArgumentException("The 'MDLMeshVectorType type' argument needs a value.");
            }
        }
示例#2
0
 internal MDLMesh(MDLMesh mesh, int submeshIndex, uint subdivisionLevels, IMDLMeshBufferAllocator allocator)
 {
     InitializeHandle(InitMesh(mesh, submeshIndex, subdivisionLevels, allocator), "initMeshBySubdividingMesh:submeshIndex:subdivisionLevels:allocator:");
 }
示例#3
0
 public static MDLMesh CreateBox(Vector3 dimensions, Vector3i segments, MDLGeometryType geometryType, bool inwardNormals, IMDLMeshBufferAllocator allocator)
 {
     return(CreateBox(dimensions, segments, geometryType, inwardNormals, allocator, MDLMeshVectorType.Dimensions));
 }
示例#4
0
 internal MDLMesh(Vector3 extent, Vector2i segments, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     InitializeHandle(InitPlane(extent, segments, geometryType, allocator), "initPlaneWithExtent:segments:geometryType:allocator:");
 }
示例#5
0
 internal MDLMesh(Vector3 extent, bool inwardNormals, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     InitializeHandle(InitIcosahedron(extent, inwardNormals, geometryType, allocator), "initIcosahedronWithExtent:inwardNormals:geometryType:allocator:");
 }
示例#6
0
 internal MDLMesh(Vector3 extent, Vector3i segments, bool inwardNormals, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     InitializeHandle(InitBox(extent, segments, inwardNormals, geometryType, allocator), "initBoxWithExtent:segments:inwardNormals:geometryType:allocator:");
 }
示例#7
0
 internal MDLMesh(Vector3 extent, Vector2i segments, bool inwardNormals, bool topCap, bool bottomCap, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     InitializeHandle(InitCylinder(extent, segments, inwardNormals, topCap, bottomCap, geometryType, allocator), "initCylinderWithExtent:segments:inwardNormals:topCap:bottomCap:geometryType:allocator:");
 }
示例#8
0
 public static MDLMesh CreateSubdividedMesh(MDLMesh mesh, int submeshIndex, uint subdivisionLevels, IMDLMeshBufferAllocator allocator)
 {
     return(new MDLMesh(mesh, submeshIndex, subdivisionLevels, allocator));
 }
示例#9
0
 internal MDLMesh(Vector3 extent, Vector2i segments, bool inwardNormals, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator, int?hemisphereSegments, bool?cap, bool?isCone)
 {
     if (hemisphereSegments.HasValue)
     {
         // initCapsule
         InitializeHandle(InitCapsule(extent, segments, hemisphereSegments.Value, inwardNormals, geometryType, allocator), "initCapsuleWithExtent:cylinderSegments:hemisphereSegments:inwardNormals:geometryType:allocator:");
     }
     else if (cap.HasValue && isCone.HasValue)
     {
         // initHemisphere || initCone
         if (isCone.Value)
         {
             InitializeHandle(InitCone(extent, segments, inwardNormals, cap.Value, geometryType, allocator), "initConeWithExtent:segments:inwardNormals:cap:geometryType:allocator:");
         }
         else
         {
             InitializeHandle(InitHemisphere(extent, segments, inwardNormals, cap.Value, geometryType, allocator), "initHemisphereWithExtent:segments:inwardNormals:cap:geometryType:allocator:");
         }
     }
     else
     {
         // initSphere
         InitializeHandle(InitSphere(extent, segments, inwardNormals, geometryType, allocator), "initSphereWithExtent:segments:inwardNormals:geometryType:allocator:");
     }
 }
示例#10
0
 public static MDLMesh CreateIcosahedron(Vector3 extent, bool inwardNormals, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     return(new MDLMesh(extent, inwardNormals, geometryType, allocator));
 }
示例#11
0
 public static MDLMesh CreatePlane(Vector3 extent, Vector2i segments, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     return(new MDLMesh(extent, segments, geometryType, allocator));
 }
示例#12
0
 public static MDLMesh CreateCone(Vector3 dimensions, Vector2i segments, MDLGeometryType geometryType, bool inwardNormals, bool cap, IMDLMeshBufferAllocator allocator)
 {
     return(new MDLMesh(dimensions, segments, inwardNormals, geometryType, allocator, null, cap, true));
 }
示例#13
0
 public static MDLMesh CreateCapsule(Vector3 dimensions, Vector2i segments, MDLGeometryType geometryType, bool inwardNormals, int hemisphereSegments, IMDLMeshBufferAllocator allocator)
 {
     return(new MDLMesh(dimensions, segments, inwardNormals, geometryType, allocator, hemisphereSegments, null, null));
 }
示例#14
0
 public static MDLMesh CreateCylinder(Vector3 extent, Vector2i segments, bool inwardNormals, bool topCap, bool bottomCap, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     return(new MDLMesh(extent, segments, inwardNormals, topCap, bottomCap, geometryType, allocator));
 }