MutableVertexData
Mutable implementation of vertex data for 3D graphics. This class provides a container for vertex attributes such as positions, texture coordinates, colors, normals, tangents, and bitangents with mutable backing lists. It allows modification of vertex data.
This class implements the IVertexData interface, enabling conversion between mutable and immutable representations of vertex data.
Constructors
Creates a MutableVertexData object with optional initial data provided as mutable lists for positions, texture coordinates, colors, normals, tangents, and bitangents.
Properties
Mutable list of vertex bitangents as Vector3.
Mutable list of vertex colors as ColorRGBa.
Mutable list of vertex normals as Vector3.
Mutable list of vertex positions as Vector3.
Mutable list of vertex tangents as Vector3.
Mutable list of 2D texture coordinates as Vector2.
Functions
Adds a Point to the vertex data by updating the corresponding mutable lists of vertex attributes. Each optional attribute of the point is only added if it is not null.
Retrieves a Point instance from the vertex data at the specified indices. The indices allow access to positions, texture coordinates, colors, normals, tangents, and bitangents.
Converts the vertex data represented by the current instance into a mutable MutableVertexData object. This includes attributes such as positions, texture coordinates, colors, normals, tangents, and bitangents.
Converts the vertex data stored in the IVertexData instance to a VertexBuffer. The method iterates through the vertex attributes such as positions, normals, texture coordinates, and colors, and writes them sequentially into the provided or newly created VertexBuffer. Missing attributes are substituted with default values.
Converts the vertex data represented by the current instance into an immutable VertexData object. This includes attributes such as positions, texture coordinates, colors, normals, tangents, and bitangents.