IVertexData

interface IVertexData(source)

Interface representing vertex data for 3D graphics. This includes attributes such as positions, texture coordinates, colors, normals, tangents, and bitangents. It provides methods to convert the data to either immutable or mutable vertex data representations.

Inheritors

Properties

Link copied to clipboard
abstract val bitangents: List<Vector3>

Vertex bitangents

Link copied to clipboard
abstract val colors: List<ColorRGBa>

Vertex colors

Link copied to clipboard
abstract val normals: List<Vector3>

Vertex normals

Link copied to clipboard
abstract val positions: List<Vector3>

Vertex positions

Link copied to clipboard
abstract val tangents: List<Vector3>

Vertex tangents

Link copied to clipboard
abstract val textureCoords: List<Vector2>

Vertex texture coordinates

Functions

Link copied to clipboard
operator fun IVertexData.get(index: Int, textureCoordsIndex: Int = index, colorsIndex: Int = index, normalsIndex: Int = index, tangentsIndex: Int = index, bitangentsIndex: Int = index): Point

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.

Link copied to clipboard

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.

Link copied to clipboard
fun IVertexData.toVertexBuffer(elementOffset: Int = 0, vertexBuffer: VertexBuffer? = null): VertexBuffer

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.

Link copied to clipboard
abstract fun toVertexData(): VertexData

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.