Submesh Class |
Namespace: DigitalRune.Graphics
The Submesh type exposes the following members.
Name | Description | |
---|---|---|
Dispose |
Releases all resources used by an instance of the Submesh class.
| |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the Submesh class
and optionally releases the managed resources.
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Draw |
Draws the Submesh using the currently active shader.
(Defined by MeshHelper.) | |
GetMaterial |
Gets the material of a submesh.
(Defined by MeshHelper.) | |
SetMaterial |
Sets the material for a submesh.
(Defined by MeshHelper.) | |
ToTriangleMesh | Overloaded.
Creates a TriangleMesh from a Submesh.
(Defined by MeshHelper.) | |
ToTriangleMesh(TriangleMesh) | Overloaded.
Adds the triangles from the specified Submesh to a
TriangleMesh.
(Defined by MeshHelper.) |
Name | Description | |
---|---|---|
IndexBuffer |
Gets or sets the index buffer.
| |
MaterialIndex |
Gets or sets or sets the index of the material.
| |
Mesh |
Gets the mesh that own this submesh.
| |
MorphTargets |
Gets or sets the morph targets of the submesh.
| |
PrimitiveCount |
Gets or sets the number of primitives (usually the number of triangles).
| |
PrimitiveType |
Gets or sets the type of the primitive.
| |
StartIndex |
Gets or sets the location in the index array at which to start reading vertices.
| |
StartVertex |
Gets or sets the index of the first vertex in the vertex buffer that belongs to this submesh
(a.k.a base vertex or vertex offset).
| |
UserData |
Gets or sets user-defined data.
| |
VertexBuffer |
Gets or sets the vertex buffer.
| |
VertexCount |
Gets or sets the number of vertices.
|
A Mesh has a collection of Materials and is subdivided into several submeshes. Each Submesh describes a batch of primitives that use the same vertex buffer and the same material, which means a submesh can be rendered with one draw call.
The submesh references a VertexBuffer and an IndexBuffer. These buffers are usually shared with other submeshes of the same model.
The submesh uses a continuous part of the VertexBuffer, starting at StartVertex and containing VertexCount vertices. The submesh also uses a continuous part of the IndexBuffer, starting at StartIndex. PrimitiveCount defines the number of primitives (usually triangles) that belong to this submesh.