Class MeshBuilder
- Assembly
- MonoGame.Framework.Content.Pipeline.dll
public sealed class MeshBuilder
- Inheritance
-
MeshBuilder
- Inherited Members
Properties
MergeDuplicatePositions
Gets or sets the current value for position merging of the mesh.
public bool MergeDuplicatePositions { get; set; }
Property Value
MergePositionTolerance
Gets or sets the tolerance for MergeDuplicatePositions.
public float MergePositionTolerance { get; set; }
Property Value
Name
Gets or sets the name of the current MeshContent object being processed.
public string Name { get; set; }
Property Value
SwapWindingOrder
Reverses the triangle winding order of the specified mesh.
public bool SwapWindingOrder { get; set; }
Property Value
Methods
AddTriangleVertex(int)
Adds a vertex into the index collection.
public void AddTriangleVertex(int indexIntoVertexCollection)
Parameters
indexIntoVertexCollection
intIndex of the inserted vertex, in the collection. This corresponds to the value returned by CreatePosition(float, float, float).
CreatePosition(Vector3)
Inserts the specified vertex position into the vertex channel at the specified index.
public int CreatePosition(Vector3 pos)
Parameters
pos
Vector3Value of the vertex being inserted.
Returns
- int
Index of the vertex being inserted.
CreatePosition(float, float, float)
Inserts the specified vertex position into the vertex channel.
public int CreatePosition(float x, float y, float z)
Parameters
x
floatValue of the x component of the vector.
y
floatValue of the y component of the vector.
z
floatValue of the z component of the vector.
Returns
- int
Index of the inserted vertex.
CreateVertexChannel<T>(string)
public int CreateVertexChannel<T>(string usage)
Parameters
usage
string
Returns
Type Parameters
T
FinishMesh()
Ends the creation of a mesh.
public MeshContent FinishMesh()
Returns
- MeshContent
Resultant mesh.
SetMaterial(MaterialContent)
Sets the material for the next triangles.
public void SetMaterial(MaterialContent material)
Parameters
material
MaterialContentMaterial for the next triangles.
Remarks
Sets the material for the triangles being defined next. This material and the opaque data dictionary, set with SetOpaqueData(OpaqueDataDictionary) define the GeometryContent object containing the next triangles. When you set a new material or opaque data dictionary the triangles you add afterwards will belong to a new GeometryContent object.
SetOpaqueData(OpaqueDataDictionary)
Sets the opaque data for the next triangles.
public void SetOpaqueData(OpaqueDataDictionary opaqueData)
Parameters
opaqueData
OpaqueDataDictionaryOpaque data dictionary for the next triangles.
Remarks
Sets the opaque data dictionary for the triangles being defined next. This dictionary and the material, set with SetMaterial(MaterialContent), define the GeometryContent object containing the next triangles. When you set a new material or opaque data dictionary the triangles you add afterwards will belong to a new GeometryContent object.
SetVertexChannelData(int, object)
Sets the specified vertex data with new data.
public void SetVertexChannelData(int vertexDataIndex, object channelData)
Parameters
vertexDataIndex
intIndex of the vertex data channel being set. This should match the index returned by CreateVertexChannel.
channelData
objectNew data values for the vertex data. The data type being set must match the data type for the vertex channel specified by vertexDataIndex.
StartMesh(string)
Initializes the creation of a mesh.
public static MeshBuilder StartMesh(string name)
Parameters
name
stringName of the mesh.
Returns
- MeshBuilder
Object used when building the mesh.