NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
nnl::vertexde Namespace Reference

Contains functions that facilitate conversion of vertex data. More...

Namespaces

namespace  fmt
 This namespace contains constants and functions for defining the vertex format.
namespace  fmt_code
 This namespace defines constants that represent fundamental format codes.
namespace  fmt_mask
 This namespace contains constants representing bit masks for parts of the vertex format.
namespace  fmt_shift
 This namespace contains constants representing shift values that are applied to format codes to create the vertex format constants.

Classes

struct  VertexLayout
 Structure representing the layout of a vertex. More...

Functions

std::vector< SVertexDecode (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 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.
u32 GetThrough (u32 vertex_format)
 Retrieves the Through Mode status from the vertex format.
u32 GetWeightFormat (u32 vertex_format)
 Retrieves the weight format code from the vertex format.
u32 GetWeightSize (u32 vertex_format)
 Retrieves the byte size of a weight component from the vertex format.
u32 GetWeightNum (u32 vertex_format)
 Retrieves the number of weight components from the vertex format.
u32 GetUVFormat (u32 vertex_format)
 Retrieves the UV format code from the vertex format.
u32 GetUVSize (u32 vertex_format)
 Retrieves the byte size of a UV component from the vertex format.
u32 GetUVNum (u32 vertex_format)
 Retrieves the number of UV components.
u32 GetColorFormat (u32 vertex_format)
 Retrieves the color format code from the vertex format.
u32 GetColorSize (u32 vertex_format)
 Retrieves the byte size of a vertex color from the vertex format.
u32 GetColorNum (u32 vertex_format)
 Retrieves the number of colors.
u32 GetNormalFormat (u32 vertex_format)
 Retrieves the normal format code from the vertex format.
u32 GetNormalSize (u32 vertex_format)
 Retrieves the byte size of a normal component from the vertex format.
u32 GetNormalNum (u32 vertex_format)
 Retrieves the number of normal components from the vertex format.
u32 GetPositionFormat (u32 vertex_format)
 Retrieves the position format code from the vertex format.
u32 GetPositionSize (u32 vertex_format)
 Retrieves the byte size of a position component from the vertex format.
u32 GetPositionNum (u32 vertex_format)
 Retrieves the number of position components.
u32 GetMorphNum (u32 vertex_format)
 Retrieves the number of morph targets from the vertex format.
u32 GetIndexFormat (u32 vertex_format)
 Retrieves the index format code from the vertex format.
u32 GetIndexSize (u32 vertex_format)
 Retrieves the byte size of a single index from the vertex format.
bool HasWeights (u32 vertex_format)
 Checks if the vertex format includes weight information.
bool HasUV (u32 vertex_format)
 Checks if the vertex format includes UV information.
bool HasColor (u32 vertex_format)
 Checks if the vertex format includes color information.
bool HasNormal (u32 vertex_format)
 Checks if the vertex format includes normal information.
bool HasPosition (u32 vertex_format)
 Checks if the vertex format includes position information.
bool IsIndexed (u32 vertex_format)
 Checks if the vertex format uses indexed drawing.
bool IsThrough (u32 vertex_format)
 Checks if the vertex format uses Through Mode (2D drawing).
bool Is8Indices (u32 vertex_format)
 Checks if the vertex format uses 8-bit indices.
bool Is16Indices (u32 vertex_format)
 Checks if the vertex format uses 16-bit indices.
bool Is8Weights (u32 vertex_format)
 Checks if the vertex format uses 8-bit weights.
bool Is16Weights (u32 vertex_format)
 Checks if the vertex format uses 16-bit weights.
bool Is32Weights (u32 vertex_format)
 Checks if the vertex format uses float weights.
bool IsFixedWeights (u32 vertex_format)
 Checks if the vertex format uses fixed-point weights.
bool Is8UV (u32 vertex_format)
 Checks if the vertex format uses 8-bit UVs.
bool Is16UV (u32 vertex_format)
 Checks if the vertex format uses 16-bit UVs.
bool Is32UV (u32 vertex_format)
 Checks if the vertex format uses float UVs.
bool IsFixedUV (u32 vertex_format)
 Checks if the vertex format uses fixed-point UV components.
bool Is565Color (u32 vertex_format)
 Checks if the vertex format uses 565 vertex colors.
bool Is5551Color (u32 vertex_format)
 Checks if the vertex format uses 5551 vertex colors.
bool Is4444Color (u32 vertex_format)
 Checks if the vertex format uses 4444 vertex colors.
bool Is8888Color (u32 vertex_format)
 Checks if the vertex format uses 8888 vertex colors.
bool Is8Normal (u32 vertex_format)
 Checks if the vertex format uses 8-bit normals.
bool Is16Normal (u32 vertex_format)
 Checks if the vertex format uses 16-bit normal components.
bool Is32Normal (u32 vertex_format)
 Checks if the vertex format uses float normals.
bool IsFixedNormal (u32 vertex_format)
 Checks if the vertex format uses fixed-point normals.
bool Is8Position (u32 vertex_format)
 Checks if the vertex format uses 8-bit positions.
bool Is16Position (u32 vertex_format)
 Checks if the vertex format uses 16-bit positions.
bool Is32Position (u32 vertex_format)
 Checks if the vertex format uses float positions.
bool IsFixedPosition (u32 vertex_format)
 Checks if the vertex format uses fixed-point positions.
std::string GetDescription (u32 vertex_format)
 Generates a textual description of the vertex format.
VertexLayout GetLayout (u32 vertex_format)
 Retrieves the layout of a vertex based on its format.

Variables

constexpr std::array< u32, 8 > format_sizes {0, 1, 2, 4, 2, 2, 2, 4}
 Maps format codes to attribute sizes.

Detailed Description

Contains functions that facilitate conversion of vertex data.

The vertexde namespace provides methods that enable conversion between a simple higher-level vertex representation and binary vertex buffers supported by the GE.

See also
nnl::vertexde::fmt
nnl::vertexde::Decode
nnl::vertexde::Encode
nnl::SVertex
nnl::model::Model