VertexContent

class VertexContent : System.Object

Provides methods and properties for maintaining the vertex data of a GeometryContent.

readonly VertexChannelCollection Channels

Gets the list of named vertex data channels in the VertexContent.

Value:Collection of vertex data channels.
readonly Microsoft.Xna.Framework.Content.Pipeline.Graphics.VertexChannel<Int32> PositionIndices

Gets the list of position indices.

Value:Position of the position index being retrieved.
readonly IndirectPositionCollection Positions

Gets position data from the parent mesh object.

Value:Collection of vertex positions for the mesh.
readonly int VertexCount

Number of vertices for the content.

Value:Number of vertices.
public int Add(int positionIndex)

Appends a new vertex index to the end of the PositionIndices collection. Other vertex channels will automatically be extended and the new indices populated with default values.

Parameters:
  • positionIndex (int) – Index into the MeshContent.Positions member of the parent.
Returns:

Index of the new entry. This can be added to the Indices member of the parent.

public void AddRange(System.Collections.Generic.IEnumerable<Int32> positionIndexCollection)

Appends multiple vertex indices to the end of the PositionIndices collection. Other vertex channels will automatically be extended and the new indices populated with default values.

Parameters:
  • positionIndexCollection (System.Collections.Generic.IEnumerable<Int32>) – Index into the Positions member of the parent.
public VertexBufferContent CreateVertexBuffer()

Converts design-time vertex position and channel data into a vertex buffer format that a graphics device can recognize.

Returns:A packed vertex buffer.
public void Insert(int index, int positionIndex)

Inserts a new vertex index to the PositionIndices collection. Other vertex channels will automatically be extended and the new indices populated with default values.

Parameters:
  • index (int) – Vertex index to be inserted.
  • positionIndex (int) – Position of new vertex index in the collection.
public void InsertRange(int index, System.Collections.Generic.IEnumerable<Int32> positionIndexCollection)

Inserts multiple vertex indices to the PositionIndices collection. Other vertex channels will automatically be extended and the new indices populated with default values.

Parameters:
  • index (int) – Vertex index to be inserted.
  • positionIndexCollection (System.Collections.Generic.IEnumerable<Int32>) – Position of the first element of the inserted range in the collection.
public void RemoveAt(int index)

Removes a vertex index from the specified location in both PositionIndices and VertexChannel<T>.

Parameters:
  • index (int) – Index of the vertex to be removed.
public void RemoveRange(int index, int count)

Removes a range of vertex indices from the specified location in both PositionIndices and VertexChannel<T>.

Parameters:
  • index (int) – Index of the first vertex index to be removed.
  • count (int) – Number of indices to remove.