Ejemplo n.º 1
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:");
     }
 }
Ejemplo n.º 2
0
        public MDLNoiseTexture(float input, string name, Vector2i textureDimensions, MDLTextureChannelEncoding channelEncoding, MDLNoiseTextureType type)
        {
            // two different `init*` would share the same C# signature
            switch (type)
            {
            case MDLNoiseTextureType.Vector:
                Handle = InitVectorNoiseWithSmoothness(input, name, textureDimensions, channelEncoding);
                break;

            case MDLNoiseTextureType.Cellular:
                Handle = InitCellularNoiseWithFrequency(input, name, textureDimensions, channelEncoding);
                break;

            default:
                throw new ArgumentException("type");
            }
        }
Ejemplo n.º 3
0
 public MDLNoiseTexture(float input, string name, Vector2i textureDimensions, MDLTextureChannelEncoding channelEncoding) : this(input, name, textureDimensions, channelEncoding, MDLNoiseTextureType.Vector)
 {
 }
Ejemplo n.º 4
0
 public NodeType GetNodeAt <NodeType> (Vector2i position) where NodeType : GKGridGraphNode
 {
     return(Runtime.GetNSObject <NodeType> (_GetNodeAt(position)));
 }
Ejemplo n.º 5
0
 public virtual GKGridGraphNode GetNodeAt(Vector2i position)
 {
     return(GetNodeAt <GKGridGraphNode> (position));
 }
Ejemplo n.º 6
0
 internal MDLMesh(Vector3 extent, Vector2i segments, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     InitializeHandle(InitPlane(extent, segments, geometryType, allocator), "initPlaneWithExtent:segments:geometryType:allocator:");
 }
Ejemplo n.º 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:");
 }
Ejemplo n.º 8
0
 public static MDLMesh CreatePlane(Vector3 extent, Vector2i segments, MDLGeometryType geometryType, IMDLMeshBufferAllocator allocator)
 {
     return(new MDLMesh(extent, segments, geometryType, allocator));
 }
Ejemplo n.º 9
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));
 }
Ejemplo n.º 10
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));
 }
Ejemplo n.º 11
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));
 }