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

#include <vvd.hpp>

Public Member Functions

 Vvd (const std::weak_ptr< std::vector< std::byte > > &data, const std::optional< int32_t > &checksum=std::nullopt)
 
int32_t getChecksum () const
 
const std::vector< Structs::Vvd::Vertex > & getVertices () const
 
const std::vector< Structs::Vector4D > & getTangents () const
 
int32_t getLevelsOfDetail () const
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Vvd()

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

Parses a .vvd 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

◆ getChecksum()

int32_t MdlParser::Vvd::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.

◆ getLevelsOfDetail()

int32_t MdlParser::Vvd::getLevelsOfDetail ( ) const

Gets the number of levels of detail (LoDs) that should be present in the model.

Returns
Number of levels.

◆ getTangents()

const std::vector< Vector4D > & MdlParser::Vvd::getTangents ( ) const

Gets the list of tangents in this VVD.

Remarks
These are stored separately from the primary vertex data, and are indexed using different offsets in the MDL file.
Returns
List of tangents.

◆ getVertices()

const std::vector< Vertex > & MdlParser::Vvd::getVertices ( ) const

Gets the list of vertices in this VVD.

Returns
List of vertices.

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