Click or drag to resize
Ab4d.SharpEngine logo

SubMesh Class

SubMesh can be used by the MultiMaterialModelNode to use one mesh with different materials. Each SubMesh defines which triangles are rendered by which material.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.MeshesSubMesh

Namespace: Ab4d.SharpEngine.Meshes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class SubMesh

The SubMesh type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyBackMaterialIndex Gets or sets an index of the material defined in the Materials list in the MultiMaterialModelNode. The material is used to render the back side of the triangles defined by this sub mesh. When smaller than 0, then the back front side material is not rendered for this sub mesh.
Public propertyBoundingBox BoundingBox of this SubMesh. When BoundingBox.IsUndefined is true, then BoundingBox of parent Mesh is used.
Public propertyIndexCount Number of triangle indices to render. For example, when set to 6, then 2 triangles will be rendered. This number is clamped to a value between zero and triangle indices count minus StartIndexLocation.
Public propertyMaterialIndex Gets or sets an index of the material defined in the Materials list in the MultiMaterialModelNode. The material is used to render the front side of the triangles defined by this sub mesh. When smaller than 0, then the front side material is not rendered for this sub mesh.
Public propertyName Name
Public propertyStartIndexLocation Start index in IndexBuffer in the Mesh that was used to create the MultiMaterialModelNode. Note that index numbers are not triangle indexes but indices in the IndexBuffer. For example to set start location to the second triangle, set StartIndexLocation to 3 (indices from 0 to 2 define the first triangle). This number is clamped to a value between zero and triangle indices count.
Top
Methods
 NameDescription
Public methodChangeBackMaterial ChangeBackMaterial method changes the material that is used to render back-side triangles defined by this SubMesh. This changes the BackMaterialIndex. This method can be called only after the SubMesh has been added to the MultiMaterialModelNode.
Public methodChangeMaterial ChangeMaterial method changes the material that is used to render font-side triangles defined by this SubMesh. This changes the MaterialIndex. This method can be called only after the SubMesh has been added to the MultiMaterialModelNode.
Public methodUpdateBoundingBox Updates the BoundingBox of this SubMesh. This can be done only after this SubMesh was added to the MultiMaterialModelNode.
Top
See Also