wowlib
0.0.0
Read & write World of Warcraft client files — a C++26 core
Toggle main menu visibility
Loading...
Searching...
No Matches
bone.hpp
Go to the documentation of this file.
1
#pragma once
2
7
8
#include <cstdint>
9
#include <vector>
10
11
#include <welder/vocabulary.hpp>
12
13
#include <
wowlib/core/client_version.hpp
>
14
#include <
wowlib/formats/common/chunked_file.hpp
>
15
#include <
wowlib/formats/common/types.hpp
>
16
17
namespace
wowlib::formats::m2::bone
{
19
struct
[[
20
=welder::weld,
21
=welder::doc(
"The .bone file prelude: a version marker (always 1)."
)
22
]]
BoneFilePrelude
{
23
[[=welder::doc(
"The format version; always 1 so far."
)]]
24
std::uint32_t
version
= 1;
25
26
bool
operator==
(
const
BoneFilePrelude
&)
const
=
default
;
27
};
28
29
static_assert
(
sizeof
(
BoneFilePrelude
) == 4);
30
34
chunk framework; no chunk here is version-gated).
35
@see https://wowdev.wiki/BONE */
36
struct
[[
37
=welder::weld,
38
=welder::doc(R
"(
39
A .bone file (WoD+): facial-pose (FacePose 808) bone offset matrices,
40
one file per pose variant, referenced by BFID. See
41
https://wowdev.wiki/BONE.)")
42
]]
BoneFile
:
ChunkedFile<BoneFile>
{
43
static
constexpr
ClientVersion
Version
=
versions::Wod
;
44
static
constexpr
FourCCEndian
UnknownFourccEndian
=
FourCCEndian::Forward
;
45
46
[[=
formats::Header
,
47
=welder::doc(
"The raw u32 prelude (version marker)."
)]]
48
BoneFilePrelude
prelude
{};
49
50
[[
51
=
chunk
(
"BIDA"
,
FourCCEndian::Forward
),
52
=
formats::Optional
,
53
=welder::mark::no_reassign,
54
=welder::doc(
"The affected bone ids (BIDA)."
)]]
55
std::vector<std::uint16_t>
boneIds
;
56
57
[[
58
=
chunk
(
"BOMT"
,
FourCCEndian::Forward
),
59
=
formats::Optional
,
60
=welder::mark::no_reassign,
61
=welder::doc(
"The per-bone offset matrices (BOMT), same count as "
62
"bone_ids."
)]]
63
std::vector<C44Matrix>
boneOffsetMatrices
;
64
65
bool
operator==
(
const
BoneFile
&)
const
=
default
;
66
};
67
}
chunked_file.hpp
The chunk framework, vocabulary and engine in one header.
client_version.hpp
Client version identity, the flavor axis that separates a client's CONTENT version from the engine ge...
wowlib::formats::m2::bone
The .bone facial-pose file entity (WoD+).
Definition
bone.hpp:17
wowlib::formats::Header
constexpr detail::HeaderSpec Header
Mark a member as a container payload's raw header prelude (e.g.
Definition
annotations.hpp:192
wowlib::formats::Optional
constexpr detail::OptionalSpec Optional
Mark a chunk member the format does not require: absence on read is fine.
Definition
annotations.hpp:188
wowlib::formats::FourCCEndian
FourCCEndian
How a chunk's FourCC characters are laid out on disk.
Definition
fourcc.hpp:14
wowlib::formats::FourCCEndian::Forward
@ Forward
The characters are stored as written: 'AFID' appears in the file as the bytes "AFID".
Definition
fourcc.hpp:22
wowlib::formats::chunk
consteval detail::ChunkSpec chunk(const char(&cc)[5], FourCCEndian endian=FourCCEndian::Reversed)
Declare the chunk a member maps to.
Definition
annotations.hpp:174
wowlib::versions::Wod
constexpr ClientVersion Wod
Definition
client_version.hpp:130
wowlib::ClientVersion
Definition
client_version.hpp:33
wowlib::formats::ChunkedFile
The serialization face of a chunked entity, mixed in CRTP-style: an entity struct E : ChunkedFile<E> ...
Definition
chunked_file.hpp:89
wowlib::formats::m2::bone::BoneFilePrelude
The .bone raw prelude: a version marker, always 1 so far.
Definition
bone.hpp:20
wowlib::formats::m2::bone::BoneFilePrelude::version
std::uint32_t version
The format version; always 1 so far.
Definition
bone.hpp:22
wowlib::formats::m2::bone::BoneFilePrelude::operator==
bool operator==(const BoneFilePrelude &) const =default
wowlib::formats::m2::bone::BoneFile
One .bone file: which bones get facial-pose offset matrices, and the matrices.
Definition
bone.hpp:34
wowlib::formats::m2::bone::BoneFile::boneOffsetMatrices
std::vector< C44Matrix > boneOffsetMatrices
The per-bone offset matrices (BOMT), same count as bone_ids.
Definition
bone.hpp:48
wowlib::formats::m2::bone::BoneFile::prelude
BoneFilePrelude prelude
The raw u32 prelude (version marker).
Definition
bone.hpp:40
wowlib::formats::m2::bone::BoneFile::UnknownFourccEndian
static constexpr FourCCEndian UnknownFourccEndian
Definition
bone.hpp:36
wowlib::formats::m2::bone::BoneFile::boneIds
std::vector< std::uint16_t > boneIds
The affected bone ids (BIDA).
Definition
bone.hpp:44
wowlib::formats::m2::bone::BoneFile::Version
static constexpr ClientVersion Version
Definition
bone.hpp:35
wowlib::formats::m2::bone::BoneFile::operator==
bool operator==(const BoneFile &) const =default
types.hpp
The binary-level math and color primitives shared across WoW file formats (wowdev....
src
wowlib
formats
m2
bone
bone.hpp
Generated by
1.17.0