MDLParser
Simple and modern library for parsing the Source engine model formats
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
MdlParser::Vtx Class Reference

#include <vtx.hpp>

Classes

struct  BodyPart
 
struct  MaterialReplacement
 
struct  Mesh
 
struct  Model
 
struct  ModelLod
 
struct  Strip
 
struct  StripGroup
 

Public Member Functions

 Vtx (const std::weak_ptr< std::vector< std::byte > > &data, const std::optional< int32_t > &checksum=std::nullopt)
 
int32_t getChecksum () const
 
const std::vector< MaterialReplacement > & getMaterialReplacements (const int lod) const
 
const std::vector< BodyPart > & getBodyParts () const
 

Detailed Description

Parses a .vtx file from a buffer into an easier to traverse structure using STL containers.

Constructor & Destructor Documentation

◆ Vtx()

MdlParser::Vtx::Vtx ( const std::weak_ptr< std::vector< std::byte > > &  data,
const std::optional< int32_t > &  checksum = std::nullopt 
)
explicit

Parses a .vtx file contained in the given buffer into an easier to use and more modern structure. No ownership of the data is taken as all contents are copied into new structs.

Parameters
data
checksumOptional checksum to validate against the header's

Member Function Documentation

◆ getBodyParts()

const std::vector< Vtx::BodyPart > & MdlParser::Vtx::getBodyParts ( ) const

Gets the body parts (body groups) which make up this model.

Returns

◆ getChecksum()

int32_t MdlParser::Vtx::getChecksum ( ) const

Gets the checksum shared by the MDL, VTX and VVD from the header.

Remarks
Can be used to loosely verify that a collection of MDL, VTX and VVD files were compiled from the same asset.
Returns
int32_t checksum

◆ getMaterialReplacements()

const std::vector< Vtx::MaterialReplacement > & MdlParser::Vtx::getMaterialReplacements ( const int  lod) const

Gets the material replacements for a given level of detail.

Parameters
lod
Returns
The material replacements list.

The documentation for this class was generated from the following files: