Table of Contents

Class ModelMeshPart

Namespace
Microsoft.Xna.Framework.Graphics
Assembly
MonoGame.Framework.dll

Represents a batch of geometry information to submit to the graphics device during rendering. Each ModelMeshPart is a subdivision of a ModelMesh object. The ModelMesh class is split into multiple ModelMeshPart objects, typically based on material information.

public sealed class ModelMeshPart
Inheritance
ModelMeshPart
Inherited Members

Remarks

It is not necessary to use this class directly. In advanced rendering scenarios, it is possible to draw using ModelMeshPart properties in combination with the vertex and index buffers on ModelMesh. However, in most cases, Draw() will be sufficient.

Constructors

ModelMeshPart()

Using this constructor is strongly discouraged. Adding meshes to models at runtime is not supported and may lead to NullReferenceExceptions if parent is not set.

[Obsolete("This constructor is deprecated and will be made internal in a future release.")]
public ModelMeshPart()

Properties

Effect

Gets or sets the material Effect for this mesh part.

public Effect Effect { get; set; }

Property Value

Effect

IndexBuffer

Gets the index buffer for this mesh part.

public IndexBuffer IndexBuffer { get; set; }

Property Value

IndexBuffer

NumVertices

Gets the number of vertices used during a draw call.

public int NumVertices { get; set; }

Property Value

int

PrimitiveCount

Gets the number of primitives to render.

public int PrimitiveCount { get; set; }

Property Value

int

StartIndex

Gets the location in the index array at which to start reading vertices.

public int StartIndex { get; set; }

Property Value

int

Tag

Gets or sets an object identifying this model mesh part.

public object Tag { get; set; }

Property Value

object

VertexBuffer

Gets the vertex buffer for this mesh part.

public VertexBuffer VertexBuffer { get; set; }

Property Value

VertexBuffer

VertexOffset

Gets the offset (in vertices) from the top of vertex buffer.

public int VertexOffset { get; set; }

Property Value

int