wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::formats::wmo::group::detail::WMOGroupBody< V > Struct Template Reference

The MOGP container payload for one client version. More...

#include <wowlib/formats/wmo/group/group.hpp>

Inheritance diagram for wowlib::formats::wmo::group::detail::WMOGroupBody< V >:

Public Member Functions

std::size_t texcoordSetCount () const
std::vector< C2Vector > * texcoordSet (std::size_t set)
Result< void > setTexcoordSet (std::size_t set, std::vector< C2Vector > coords)
Result< void > appendTexcoordSet (std::vector< C2Vector > coords)
void clearTexcoordSets ()
std::size_t vertexColorLayerCount () const
std::vector< CImVector > * vertexColorLayer (std::size_t layer)
Result< void > setVertexColorLayer (std::size_t layer, std::vector< CImVector > colors)
Result< void > appendVertexColorLayer (std::vector< CImVector > colors)
void clearVertexColorLayers ()
std::size_t activeIndexCount () const
 The number of triangle vertex indices the group's batches and BSP reference: MOVX (the large-mesh replacement) when engaged, MOVI otherwise.
void validateExtra (ValidationReport &report) const
 Validation hook (see detail::validateEntity): the group contracts the annotations cannot express — render-batch and BSP index ranges, light-set ranges, header-flag/chunk-presence coherence and the MLIQ grid arithmetic.
Public Member Functions inherited from wowlib::formats::ChunkedFile< WMOGroupBody< V > >
Result< void > read (std::span< const std::byte > data)
 Deserialize file bytes into this entity, replacing its contents.
Result< FileBuffer > write () const
 Serialize this entity.
ValidationReport validate () const
Result< void > ensureValid () const
 Validate and raise on the first error instead of returning a report — the assert-style face of validate().
bool operator== (const ChunkedFile &) const=default
Public Member Functions inherited from wowlib::formats::ChunkExtras
bool operator== (const ChunkExtras &) const =default

Public Attributes

SMOGroupHeader< V > header {}
std::vector< SMOPoly > polys
std::vector< std::uint16_t > indices
std::vector< C3Vector > vertices
std::vector< C3Vector > normals
Repeated< std::vector< C2Vector >, 4 > texcoords
std::vector< SMOBatch< V > > batches
std::vector< std::uint16_t > lightRefs
std::vector< std::uint16_t > doodadRefs
std::vector< CAaBspNode > bspNodes
std::vector< std::uint16_t > bspFaceIndices
Repeated< std::vector< CImVector >, 2 > vertexColors
MLIQData liquid
std::vector< std::uint16_t > transBatchIndices
Public Attributes inherited from wowlib::formats::ChunkExtras
std::vector< JournalEntry > journal
std::vector< UnknownChunk > unknown
std::vector< std::byte > trailing

Static Public Attributes

static constexpr ClientVersion Version = V
static constexpr std::array ChunkOrder
 The canonical chunk-stream order the serializer emits a fresh entity in — decoupled from the by-trait flatten order of the version bases.

Detailed Description

template<ClientVersion V>
struct wowlib::formats::wmo::group::detail::WMOGroupBody< V >

The MOGP container payload for one client version.

MOGP wraps the geometry that makes up one WMO group: the group header followed by the triangle/vertex/normal arrays, texture coordinates, render batches, the collision BSP tree, liquid grid and — on later clients — the group-local light and volume reference chunks. The always-present chunks are own members (canonical order); version-gated chunks are inherited from the detail:: trait bases active for V.

Template Parameters
Vthe client version this layout targets.
See also
https://wowdev.wiki/WMO

Definition at line 230 of file group.hpp.

Member Function Documentation

◆ activeIndexCount()

template<ClientVersion V>
std::size_t wowlib::formats::wmo::group::detail::WMOGroupBody< V >::activeIndexCount ( ) const
inline

The number of triangle vertex indices the group's batches and BSP reference: MOVX (the large-mesh replacement) when engaged, MOVI otherwise.

Returns
the active index count.

Definition at line 526 of file group.hpp.

◆ appendTexcoordSet()

template<ClientVersion V>
Result< void > wowlib::formats::wmo::group::detail::WMOGroupBody< V >::appendTexcoordSet ( std::vector< C2Vector > coords)
inlinenodiscard

Definition at line 414 of file group.hpp.

◆ appendVertexColorLayer()

template<ClientVersion V>
Result< void > wowlib::formats::wmo::group::detail::WMOGroupBody< V >::appendVertexColorLayer ( std::vector< CImVector > colors)
inlinenodiscard

Definition at line 462 of file group.hpp.

◆ clearTexcoordSets()

template<ClientVersion V>
void wowlib::formats::wmo::group::detail::WMOGroupBody< V >::clearTexcoordSets ( )
inline

Definition at line 426 of file group.hpp.

◆ clearVertexColorLayers()

template<ClientVersion V>
void wowlib::formats::wmo::group::detail::WMOGroupBody< V >::clearVertexColorLayers ( )
inline

Definition at line 474 of file group.hpp.

◆ setTexcoordSet()

template<ClientVersion V>
Result< void > wowlib::formats::wmo::group::detail::WMOGroupBody< V >::setTexcoordSet ( std::size_t set,
std::vector< C2Vector > coords )
inlinenodiscard

Definition at line 398 of file group.hpp.

◆ setVertexColorLayer()

template<ClientVersion V>
Result< void > wowlib::formats::wmo::group::detail::WMOGroupBody< V >::setVertexColorLayer ( std::size_t layer,
std::vector< CImVector > colors )
inlinenodiscard

Definition at line 446 of file group.hpp.

◆ texcoordSet()

template<ClientVersion V>
std::vector< C2Vector > * wowlib::formats::wmo::group::detail::WMOGroupBody< V >::texcoordSet ( std::size_t set)
inlinenodiscard

Definition at line 390 of file group.hpp.

◆ texcoordSetCount()

template<ClientVersion V>
std::size_t wowlib::formats::wmo::group::detail::WMOGroupBody< V >::texcoordSetCount ( ) const
inline

Definition at line 382 of file group.hpp.

◆ validateExtra()

template<ClientVersion V>
void wowlib::formats::wmo::group::detail::WMOGroupBody< V >::validateExtra ( ValidationReport & report) const
inline

Validation hook (see detail::validateEntity): the group contracts the annotations cannot express — render-batch and BSP index ranges, light-set ranges, header-flag/chunk-presence coherence and the MLIQ grid arithmetic.

Cross-entity contracts (references into the root) are the assembly's validate().

Parameters
reportthe report findings land in.

Definition at line 540 of file group.hpp.

◆ vertexColorLayer()

template<ClientVersion V>
std::vector< CImVector > * wowlib::formats::wmo::group::detail::WMOGroupBody< V >::vertexColorLayer ( std::size_t layer)
inlinenodiscard

Definition at line 438 of file group.hpp.

◆ vertexColorLayerCount()

template<ClientVersion V>
std::size_t wowlib::formats::wmo::group::detail::WMOGroupBody< V >::vertexColorLayerCount ( ) const
inline

Definition at line 430 of file group.hpp.

Member Data Documentation

◆ batches

template<ClientVersion V>
std::vector<SMOBatch<V> > wowlib::formats::wmo::group::detail::WMOGroupBody< V >::batches

Definition at line 310 of file group.hpp.

◆ bspFaceIndices

template<ClientVersion V>
std::vector<std::uint16_t> wowlib::formats::wmo::group::detail::WMOGroupBody< V >::bspFaceIndices

Definition at line 340 of file group.hpp.

◆ bspNodes

Definition at line 333 of file group.hpp.

◆ ChunkOrder

template<ClientVersion V>
std::array wowlib::formats::wmo::group::detail::WMOGroupBody< V >::ChunkOrder
staticconstexpr

The canonical chunk-stream order the serializer emits a fresh entity in — decoupled from the by-trait flatten order of the version bases.

Lists every chunk member exactly once (checked at compile time by writeOrder). The header (MOGP prelude) is written ahead of the stream, so it is not listed.

v14-alpha-only subchunks (MOLM/MOLD, MOIN, lightmap MOLV, MPB*) predate the supported range; anything else unmodeled round-trips via ChunkExtras.

Definition at line 483 of file group.hpp.

◆ doodadRefs

template<ClientVersion V>
std::vector<std::uint16_t> wowlib::formats::wmo::group::detail::WMOGroupBody< V >::doodadRefs

Definition at line 326 of file group.hpp.

◆ header

Definition at line 252 of file group.hpp.

◆ indices

template<ClientVersion V>
std::vector<std::uint16_t> wowlib::formats::wmo::group::detail::WMOGroupBody< V >::indices

Definition at line 272 of file group.hpp.

◆ lightRefs

template<ClientVersion V>
std::vector<std::uint16_t> wowlib::formats::wmo::group::detail::WMOGroupBody< V >::lightRefs

Definition at line 318 of file group.hpp.

◆ liquid

Definition at line 360 of file group.hpp.

◆ normals

Definition at line 287 of file group.hpp.

◆ polys

Definition at line 263 of file group.hpp.

◆ texcoords

Definition at line 303 of file group.hpp.

◆ transBatchIndices

template<ClientVersion V>
std::vector<std::uint16_t> wowlib::formats::wmo::group::detail::WMOGroupBody< V >::transBatchIndices

Definition at line 367 of file group.hpp.

◆ Version

template<ClientVersion V>
ClientVersion wowlib::formats::wmo::group::detail::WMOGroupBody< V >::Version = V
staticconstexpr

Definition at line 247 of file group.hpp.

◆ vertexColors

template<ClientVersion V>
Repeated<std::vector<CImVector>, 2> wowlib::formats::wmo::group::detail::WMOGroupBody< V >::vertexColors

Definition at line 352 of file group.hpp.

◆ vertices

Definition at line 279 of file group.hpp.


The documentation for this struct was generated from the following file: