MeshBuilder

class MeshBuilder : System.Object
bool MergeDuplicatePositions

Gets or sets the current value for position merging of the mesh.

float MergePositionTolerance

Gets or sets the tolerance for P:Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshBuilder.MergeDuplicatePositions.

string Name

Gets or sets the name of the current T:Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshContent object being processed.

bool SwapWindingOrder

Reverses the triangle winding order of the specified mesh.

public void AddTriangleVertex(int indexIntoVertexCollection)

Adds a vertex into the index collection.

Parameters:
  • indexIntoVertexCollection (int) –
    Index of the inserted vertex, in the collection.
    This corresponds to the value returned by M:Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshBuilder.CreatePosition(System.Single,System.Single,System.Single).
public int CreateVertexChannel<T>(string usage)
Type Parameters:
 
  • T
Parameters:
  • usage (string) –
public int CreatePosition(float x, float y, float z)

Inserts the specified vertex position into the vertex channel.

Parameters:
  • x (float) – Value of the x component of the vector.
  • y (float) – Value of the y component of the vector.
  • z (float) – Value of the z component of the vector.
Returns:

Index of the inserted vertex.

public int CreatePosition(Vector3 pos)

Inserts the specified vertex position into the vertex channel at the specified index.

Parameters:
  • pos (Microsoft.Xna.Framework.Vector3) – Value of the vertex being inserted.
Returns:

Index of the vertex being inserted.

public MeshContent FinishMesh()

Ends the creation of a mesh.

Returns:Resultant mesh.
public void SetMaterial(MaterialContent material)

Sets the material for the next triangles.

Parameters:
  • material (Microsoft.Xna.Framework.Content.Pipeline.Graphics.MaterialContent) – Material for the next triangles.
public void SetOpaqueData(OpaqueDataDictionary opaqueData)

Sets the opaque data for the next triangles.

Parameters:
  • opaqueData (Microsoft.Xna.Framework.Content.Pipeline.OpaqueDataDictionary) – Opaque data dictionary for the next triangles.
public void SetVertexChannelData(int vertexDataIndex, System.Object channelData)

Sets the specified vertex data with new data.

Parameters:
  • vertexDataIndex (int) – Index of the vertex data channel being set. This should match the index returned by CreateVertexChannel.
  • channelData (System.Object) – New data values for the vertex data. The data type being set must match the data type for the vertex channel specified by vertexDataIndex.
public MeshBuilder StartMesh(string name)

Initializes the creation of a mesh.

Parameters:
  • name (string) – Name of the mesh.
Returns:

Object used when building the mesh.