wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
map_placements.hpp
Go to the documentation of this file.
1#pragma once
2
9
10#include <cstdint>
11
12#include <welder/vocabulary.hpp>
13
15
17 enum class [[
18 =welder::weld,
19 =welder::flags,
20 =welder::doc("WMO placement flag bits (SMMapObjDef.flags).")
21 ]] MapObjDefFlags : std::uint16_t {
22 Destroyable [[=welder::doc(
23 "A destroyable, server-controllable building (e.g. the "
24 "DeathknightStart tower).")]] = 0x1,
25 UseLod [[=
26 welder::doc("Also load the _LOD1 WMO, selected by distance (WoD+).")]] =
27 0x2,
28 HasScale [[=welder::doc("The scale field is engaged: scale / 1024 applies "
29 "(Legion+; otherwise 1.0).")]] = 0x4,
30 EntryIsFdid [[=welder::doc(
31 "name_id is a FileDataID to load directly, not a name-table "
32 "index (Legion+).")]] = 0x8,
33 UseSetsFromMwds [[=welder::doc(
34 "Doodad set indices come from the ADT MWDS chunk "
35 "(Shadowlands+).")]] = 0x80
36 };
38 enum class [[
39 =welder::weld,
40 =welder::flags,
41 =welder::doc("M2 placement flag bits (SMDoodadDef.flags).")
42 ]] DoodadDefFlags : std::uint16_t {
43 Biodome [[=welder::doc(
44 "Sets the internal WDOODADDEF 0x800 flag; meaning unknown "
45 "(biodome).")]] = 0x1,
46 Shrubbery [[=welder::doc("Shrubbery; not checked by 6.0.1+ clients.")]] = 0x2,
47 Unk4 [[=welder::doc("Unknown (Legion+).")]] = 0x4,
48 Unk8 [[=welder::doc("Unknown (Legion+).")]] = 0x8,
49 Unk10 [[=
50 welder::doc("Unknown (Shadowlands+); sets flag 0x4 on the PVS doodad.")]]
51 = 0x10,
52 LiquidKnown [[=welder::doc("SMDoodadDef::Flag_liquidKnown (Legion+).")]] = 0x20,
53 EntryIsFdid [[=welder::doc(
54 "name_id is a FileDataID to load directly, not an MMID "
55 "index (Legion+).")]] = 0x40,
56 Unk100 [[=welder::doc("Unknown (Legion+).")]] = 0x100,
57 AcceptProjTextures [[=welder::doc("Accepts projected textures (Legion+).")
58 ]] = 0x1000
59 };
61 struct [[
62 =welder::weld,
63 =welder::doc(R"(
64 A WMO placement (the 64-byte MODF record of WDT, WDL and ADT): which
65 object, where, and how it is instanced.)")
67 [[=welder::doc(
68 R"(The object: an MWID/MWMO name-table reference, or a FileDataID
69 when flags has EntryIsFdid (Legion+). The WDT global-WMO
70 record ignores it and uses the MWMO content.)")]]
71 std::uint32_t nameId = 0;
72
73 [[=welder::doc(
74 "Unique instance id across the whole map (WDT global-WMO records "
75 "leave it unused).")]]
76 std::uint32_t uniqueId = 0;
77
78 [[=welder::doc("Position, in the map's placement coordinate system.")]]
80
81 [[=welder::doc("Rotation as Euler angles, degrees.")]]
83
84 [[=welder::doc(
85 "The transformed object's bounding box (position plus the rotated "
86 "extents); culling and collision use it.")]]
87 CAaBox extents{};
89 [[=welder::doc("Flags; MapObjDefFlags bits.")]]
91
92 [[=welder::doc(
93 "The WMO doodad set shown by this instance (MODS index, or MWDR when "
94 "use_sets_from_mwds is set).")]]
95 std::uint16_t doodadSet = 0;
96
97 [[=welder::doc("The WMO name set (renames the same model per instance).")]]
98 std::uint16_t nameSet = 0;
99
100 [[=welder::doc(
101 "Scale, 1024 = 1.0, engaged by the has_scale flag (Legion+); padding "
102 "in older clients.")]]
103 std::uint16_t scale = 0;
104 };
105
106 static_assert(sizeof(SMMapObjDef) == 0x40);
107
108 struct [[
109 =welder::weld,
110 =welder::doc(R"(
111 An M2 (doodad) placement (the 36-byte MDDF record of ADT, reused by the
112 WDL MLDD low-resolution set): which model, where, and at what scale.)")
113 ]] SMDoodadDef {
114 [[=welder::doc(
115 "The model: an MMID name-table reference, or a FileDataID when flags "
116 "has entry_is_fdid (Legion+; WDL MLDD entries are always "
117 "FileDataIDs).")]]
118 std::uint32_t nameId = 0;
119
120 [[=welder::doc("Unique instance id across the whole map.")]]
121 std::uint32_t uniqueId = 0;
122
123 [[=welder::doc("Position, in the map's placement coordinate system.")]]
124 C3Vector position{};
125
126 [[=welder::doc("Rotation as Euler angles, degrees.")]]
127 C3Vector rotation{};
128
129 [[=welder::doc("Scale, 1024 = 1.0.")]]
130 std::uint16_t scale = 1024;
131
132 [[=welder::doc("Flags; DoodadDefFlags bits.")]]
133 DoodadDefFlags flags{};
134 };
135
136 static_assert(sizeof(SMDoodadDef) == 0x24);
137}
DoodadDefFlags
M2 placement flag bits (SMDoodadDef.flags).
@ AcceptProjTextures
Accepts projected textures (Legion+).
@ Unk10
Unknown (Shadowlands+); sets flag 0x4 on the PVS doodad.
@ LiquidKnown
SMDoodadDef::Flag_liquidKnown (Legion+).
@ Biodome
Sets the internal WDOODADDEF 0x800 flag; meaning unknown (biodome).
@ Shrubbery
Shrubbery; not checked by 6.0.1+ clients.
MapObjDefFlags
WMO placement flag bits (SMMapObjDef.flags).
@ UseSetsFromMwds
Doodad set indices come from the ADT MWDS chunk (Shadowlands+).
@ UseLod
Also load the _LOD1 WMO, selected by distance (WoD+).
@ HasScale
The scale field is engaged: scale / 1024 applies (Legion+; otherwise 1.0).
@ EntryIsFdid
name_id is a FileDataID to load directly, not a name-table index (Legion+).
@ Destroyable
A destroyable, server-controllable building (e.g.
A 3D float vector — the workhorse: positions, normals, rotations-as-Euler-degrees in placements.
Definition types.hpp:49
An axis-aligned bounding box: minimum and maximum corners.
Definition types.hpp:134
std::uint32_t nameId
The model: an MMID name-table reference, or a FileDataID when flags has entry_is_fdid (Legion+; WDL M...
std::uint32_t uniqueId
Unique instance id across the whole map.
DoodadDefFlags flags
Flags; DoodadDefFlags bits.
std::uint16_t scale
Scale, 1024 = 1.0.
C3Vector rotation
Rotation as Euler angles, degrees.
C3Vector position
Position, in the map's placement coordinate system.
std::uint16_t nameSet
The WMO name set (renames the same model per instance).
MapObjDefFlags flags
Flags; MapObjDefFlags bits.
C3Vector position
Position, in the map's placement coordinate system.
CAaBox extents
The transformed object's bounding box (position plus the rotated extents); culling and collision use ...
std::uint32_t uniqueId
Unique instance id across the whole map (WDT global-WMO records leave it unused).
std::uint16_t doodadSet
The WMO doodad set shown by this instance (MODS index, or MWDR when use_sets_from_mwds is set).
C3Vector rotation
Rotation as Euler angles, degrees.
std::uint16_t scale
Scale, 1024 = 1.0, engaged by the has_scale flag (Legion+); padding in older clients.
The binary-level math and color primitives shared across WoW file formats (wowdev....