MDLParser
Simple and modern library for parsing the Source engine model formats
Loading...
Searching...
No Matches
Functions
MdlParser::Accessors Namespace Reference

Functions

void iterateBodyParts (const Mdl &mdl, const Vtx &vtx, const std::function< void(const Mdl::BodyPart &, const Vtx::BodyPart &)> &iteratee)
 
void iterateModels (const Mdl::BodyPart &mdlBodyPart, const Vtx::BodyPart &vtxBodyPart, const std::function< void(const Mdl::Model &, const Vtx::Model &)> &iteratee)
 
void iterateMeshes (const Mdl::Model &mdlModel, const Vtx::ModelLod &vtxModel, const std::function< void(const Mdl::Mesh &, const Vtx::Mesh &)> &iteratee)
 
void iterateVertices (const Vvd &vvd, const Mdl::Model &model, const Mdl::Mesh &mesh, const Vtx::StripGroup &stripGroup, const std::function< void(const Structs::Vtx::Vertex &, const Structs::Vvd::Vertex &, const Structs::Vector4D &)> &iteratee)
 

Detailed Description

A collection of helper functions to ease traversing the MDL, VTX and VVD structures together.

Function Documentation

◆ iterateBodyParts()

void MdlParser::Accessors::iterateBodyParts ( const Mdl mdl,
const Vtx vtx,
const std::function< void(const Mdl::BodyPart &, const Vtx::BodyPart &)> &  iteratee 
)

Iterates over the pairs of body parts in the MDL and VTX data, calling iteratee with each pair.

Parameters
mdlMDL data.
vtxVTX data.
iterateeFunction to be called for each pair, taking the MDL body part followed by the VTX body part.

◆ iterateMeshes()

void MdlParser::Accessors::iterateMeshes ( const Mdl::Model mdlModel,
const Vtx::ModelLod vtxModel,
const std::function< void(const Mdl::Mesh &, const Vtx::Mesh &)> &  iteratee 
)

Iterates over the pairs of meshes in the MDL and VTX data, calling iteratee with each pair.

Parameters
mdlModelModel in the MDL data.
vtxModelModel in the VTX data.
iterateeFunction to be called for each pair, taking the MDL mesh followed by the VTX mesh.

◆ iterateModels()

void MdlParser::Accessors::iterateModels ( const Mdl::BodyPart mdlBodyPart,
const Vtx::BodyPart vtxBodyPart,
const std::function< void(const Mdl::Model &, const Vtx::Model &)> &  iteratee 
)

Iterates over the pairs of models in the MDL and VTX data, calling iteratee with each pair.

Parameters
mdlBodyPartBody part in the MDL data.
vtxBodyPartBody part in the VTX data.
iterateeFunction to be called for each pair, taking the MDL model followed by the VTX model.

◆ iterateVertices()

void MdlParser::Accessors::iterateVertices ( const Vvd vvd,
const Mdl::Model model,
const Mdl::Mesh mesh,
const Vtx::StripGroup stripGroup,
const std::function< void(const Structs::Vtx::Vertex &, const Structs::Vvd::Vertex &, const Structs::Vector4D &)> &  iteratee 
)

Iterates over the vertex data for the given strip group, calling iteratee with the VTX and VVD vertex data plus the tangent.

Parameters
vvdParsed VVD containing per-vertex data.
modelParsed model from the MDL containing offsets into the VVD.
meshParsed mesh from the MDL containing offsets into the VVD.
stripGroupVTX strip group to read vertex data from.
iterateeFunction to be called for each vertex, taking the VTX vertex, VVD vertex and tangent (in that order).