NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches

Namespaces

namespace  nnl::vertexde::fmt
 This namespace contains constants and functions for defining the vertex format.

Functions

std::vector< SVertexnnl::vertexde::Decode (BufferView vertex_buffer, u32 vertex_format, std::array< u16, 8 > bone_indices={0})
 Extracts vertex data from a buffer and converts it to a simple representation.
Buffer nnl::vertexde::Encode (const std::vector< SVertex > &vertices, u32 vertex_format, std::array< u16, 8 > bone_indices={0})
 Converts vertex data from a simple representation to a binary vertex buffer.

Detailed Description

Function Documentation

◆ Decode()

std::vector< SVertex > nnl::vertexde::Decode ( BufferView vertex_buffer,
u32 vertex_format,
std::array< u16, 8 > bone_indices = {0} )

Extracts vertex data from a buffer and converts it to a simple representation.

This function processes the provided vertex buffer according to the specified vertex format and extracts various vertex attributes from it.

Parameters
vertex_bufferThe buffer containing the vertex data.
vertex_formatThe format of the vertex data in the buffer.
bone_indicesAn array of bone indices associated with the vertex weights.
Returns
A vector of SVertex.
Note
All of the possible vertex attributes are present in the SVertex struct. One must inspect the vertex_format to see which ones are actually used.
See also
nnl::vertexde::Encode
nnl::model::Primitive
nnl::model::SubMesh

◆ Encode()

Buffer nnl::vertexde::Encode ( const std::vector< SVertex > & vertices,
u32 vertex_format,
std::array< u16, 8 > bone_indices = {0} )

Converts vertex data from a simple representation to a binary vertex buffer.

This function converts the provided vector of SVertex structures into a binary buffer suitable for use by the GE.

Parameters
verticesA vector of SVertex to convert.
vertex_formatThe format of the vertex data, which determines how the attributes are encoded.
bone_indicesAn array of bone indices associated with the vertex weights.
Returns
A Buffer containing the serialized vertex data.
See also
nnl::vertexde::Decode
nnl::vertexde::fmt