A Resource that contains vertex-array based geometry.
    public class Mesh : Resource

Mesh is a type of Resource that contains vertex-array based geometry, divided in surfaces. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.

Inheritance Chain

Derived Classes


    public Vector2 LightmapSizeHint { get; set; }


    public Shape CreateConvexShape()

Calculate a ConvexPolygonShape from the mesh.

    public Mesh CreateOutline(float margin)

Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: Typically returns the vertices in reverse order (e.g. clockwise to anti-clockwise).

    public Shape CreateTrimeshShape()

Calculate a ConcavePolygonShape from the mesh.

    public TriangleMesh GenerateTriangleMesh()

Generate a TriangleMesh from the mesh.

    public Vector3[] GetFaces()

Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.

    public Vector2 GetLightmapSizeHint()

Getter for LightmapSizeHint

    public void SetLightmapSizeHint(Vector2 size)

Setter for LightmapSizeHint

Inner Types


Name Value Description
FormatVertex 1  
FormatNormal 2  
FormatTangent 4  
FormatColor 8  
FormatTexUv 16  
FormatTexUv2 32  
FormatBones 64  
FormatWeights 128  
FormatIndex 256  
CompressBase 9  
CompressVertex 512  
CompressNormal 1024  
CompressTangent 2048  
CompressColor 4096  
CompressTexUv 8192  
CompressTexUv2 16384  
CompressBones 32768  
CompressWeights 65536  
CompressIndex 131072  
FlagUse2dVertices 262144  
FlagUse16BitBones 524288  
CompressDefault 97792  


Name Value Description
Vertex 0  
Normal 1  
Tangent 2  
Color 3  
TexUv 4  
TexUv2 5  
Bones 6  
Weights 7  
Index 8  
Max 9  


Name Value Description
Normalized 0  
Relative 1  


Name Value Description
Points 0 Render array as points (one vertex equals one point).
Lines 1 Render array as lines (every two vertices a line is created).
LineStrip 2 Render array as line strip.
LineLoop 3 Render array as line loop (like line strip, but closed).
Triangles 4 Render array as triangles (every three vertices a triangle is created).
TriangleStrip 5 Render array as triangle strips.
TriangleFan 6 Render array as triangle fans.