wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
records.hpp
Go to the documentation of this file.
1#pragma once
2
8
9#include <array>
10#include <cstdint>
11
12#include <welder/vocabulary.hpp>
13
15
17 struct [[
18 =welder::weld,
19 =welder::doc(
20 "One WoD point light (MPLT); Legion clients stop reading these in "
21 "favor of MPL2.")
23 [[=welder::doc("Unique light id within the WDT.")]]
24 std::uint32_t id = 0;
25
26 [[=welder::doc("The ADT tile x coordinate.")]]
27 std::uint16_t tileX = 0;
28
29 [[=welder::doc("The ADT tile y coordinate.")]]
30 std::uint16_t tileY = 0;
31
32 [[=welder::doc("Light color.")]]
33 CArgb color{};
34
35 [[=welder::doc("Light position.")]]
37
38 [[=welder::doc(
39 "Intensity and related parameters; exact meaning undocumented.")]]
40 std::array<float, 3> unknown{};
41 };
42
43 static_assert(sizeof(MapPointLightLegacy) == 36);
44
45 struct [[
46 =welder::weld,
47 =welder::doc("One Legion point light (MPL2).")
48 ]] MapPointLight {
49 [[=welder::doc(
50 "Unique light id within the WDT; increment for each new light.")]]
51 std::uint32_t id = 0;
53 [[=welder::doc("Light color (b, g, r, a); alpha 0 means fully opaque.")]]
56 [[=welder::doc("Light position.")]]
59 [[=welder::doc("Where the light's spread starts; usually 0.")]]
60 float attenuationStart = 0;
62 [[=welder::doc("How far the light spreads.")]]
63 float attenuationEnd = 0;
65 [[=welder::doc("Light intensity.")]]
66 float intensity = 0;
68 [[=welder::doc("Rotation; usually zero for point lights.")]]
71 [[=welder::doc("The ADT tile x coordinate.")]]
72 std::uint16_t tileX = 0;
74 [[=welder::doc("The ADT tile y coordinate.")]]
75 std::uint16_t tileY = 0;
76
77 [[=welder::doc("Index into MLTA, or -1 when unanimated.")]]
78 std::int16_t mltaIndex = -1;
80 [[=welder::doc("Index into MTEX, or -1.")]]
81 std::int16_t textureIndex = -1;
82 };
83
84 static_assert(sizeof(MapPointLight) == 0x34);
85
86 struct [[
87 =welder::weld,
88 =welder::doc(
89 "One Shadowlands point light (MPL3; replaces MPL2 in 9.0+ files).")
91 [[=welder::doc("Unique light id within the WDT.")]]
92 std::uint32_t id = 0;
94 [[=welder::doc("Light color (b, g, r, a); alpha 0 means fully opaque.")]]
97 [[=welder::doc("Light position.")]]
100 [[=welder::doc("Where the light's spread starts.")]]
101 float attenuationStart = 0;
103 [[=welder::doc("How far the light spreads.")]]
104 float attenuationEnd = 0;
106 [[=welder::doc("Light intensity.")]]
107 float intensity = 0;
109 [[=welder::doc("Rotation; only used to orient light-cookie projection.")]]
112 [[=welder::doc("The ADT tile x coordinate.")]]
113 std::uint16_t tileX = 0;
115 [[=welder::doc("The ADT tile y coordinate.")]]
116 std::uint16_t tileY = 0;
118 [[=welder::doc("Index into MLTA, or -1 when unanimated.")]]
119 std::int16_t mltaIndex = -1;
120
121 [[=welder::doc("Index into MTEX for the light-cookie texture, or -1.")]]
122 std::int16_t textureIndex = -1;
124 [[=welder::doc(
125 "Flags; 0x1 casts raytraced shadows (D3D12, shadow RT level 2+).")]]
126 std::uint16_t flags = 0;
127
128 [[=welder::doc(
129 "Scale as a raw IEEE half-float (0.5 is the default; 10.0 hides "
130 "player shadows).")]]
131 std::uint16_t scaleHalf = 0x3800;
132 };
133
134 static_assert(sizeof(MapPointLight3) == 0x38);
135
136 struct [[
137 =welder::weld,
138 =welder::doc("One Legion spot light (MSLT).")
139 ]] MapSpotLight {
140 [[=welder::doc("Unique light id within the WDT.")]]
141 std::uint32_t id = 0;
142
143 [[=welder::doc("Light color (b, g, r, a); alpha 0 means fully opaque.")]]
145
146 [[=welder::doc("Light position.")]]
148
149 [[=welder::doc(
150 "Where the light's spread starts; must be <= attenuation_end.")]]
151 float attenuationStart = 0;
153 [[=welder::doc("How far the light spreads.")]]
154 float attenuationEnd = 0;
156 [[=welder::doc("Light intensity.")]]
157 float intensity = 0;
159 [[=welder::doc("Rotation, radians.")]]
162 [[=welder::doc("Spotlight cone radius.")]]
163 float spotlightRadius = 0;
165 [[=welder::doc("Inner cone angle, radians.")]]
166 float innerAngle = 0;
167
168 [[=welder::doc("Outer cone angle, radians.")]]
169 float outerAngle = 0;
171 [[=welder::doc("The ADT tile x coordinate.")]]
172 std::uint16_t tileX = 0;
173
174 [[=welder::doc("The ADT tile y coordinate.")]]
175 std::uint16_t tileY = 0;
176
177 [[=welder::doc("Index into MLTA, or -1 when unanimated.")]]
178 std::int16_t mltaIndex = -1;
179
180 [[=welder::doc("Index into MTEX, or -1.")]]
181 std::int16_t textureIndex = -1;
182 };
183
184 static_assert(sizeof(MapSpotLight) == 0x40);
185
186 struct [[
187 =welder::weld,
188 =welder::doc(
189 "One light texture animation (MLTA), referenced by mlta_index.")
190 ]] LightAnimation {
191 [[=welder::doc("Animation amplitude.")]]
192 float amplitude = 0;
193
194 [[=welder::doc("Animation frequency.")]]
195 float frequency = 0;
196
197 [[=welder::doc("Curve function: 0 off, 1 sine, 2 noise, 3 noise step.")]]
198 std::int32_t function = 0;
199 };
200
201 static_assert(sizeof(LightAnimation) == 12);
202}
_lgt.wdt chunk binary structs (point lights, spot lights, light animations).
Definition records.hpp:16
A 3D float vector — the workhorse: positions, normals, rotations-as-Euler-degrees in placements.
Definition types.hpp:49
A color stored as r, g, b, a bytes.
Definition types.hpp:164
A color stored as b, g, r, a bytes — the client's immediate-mode vertex color layout (WMO MOCV,...
Definition types.hpp:178
One light texture animation (MLTA), referenced by mlta_index.
Definition records.hpp:170
std::int32_t function
Curve function: 0 off, 1 sine, 2 noise, 3 noise step.
Definition records.hpp:178
One Shadowlands point light (MPL3; replaces MPL2 in 9.0+ files).
Definition records.hpp:79
std::int16_t mltaIndex
Index into MLTA, or -1 when unanimated.
Definition records.hpp:108
std::uint16_t tileX
The ADT tile x coordinate.
Definition records.hpp:102
std::uint16_t flags
Flags; 0x1 casts raytraced shadows (D3D12, shadow RT level 2+).
Definition records.hpp:114
float attenuationEnd
How far the light spreads.
Definition records.hpp:93
C3Vector rotation
Rotation; only used to orient light-cookie projection.
Definition records.hpp:99
std::uint16_t scaleHalf
Scale as a raw IEEE half-float (0.5 is the default; 10.0 hides player shadows).
Definition records.hpp:117
float attenuationStart
Where the light's spread starts.
Definition records.hpp:90
std::uint16_t tileY
The ADT tile y coordinate.
Definition records.hpp:105
CImVector color
Light color (b, g, r, a); alpha 0 means fully opaque.
Definition records.hpp:84
std::int16_t textureIndex
Index into MTEX for the light-cookie texture, or -1.
Definition records.hpp:111
One WoD point light (MPLT); Legion clients stop reading these in favor of MPL2.
Definition records.hpp:18
std::array< float, 3 > unknown
Intensity and related parameters; exact meaning undocumented.
Definition records.hpp:35
std::uint16_t tileX
The ADT tile x coordinate.
Definition records.hpp:23
std::uint16_t tileY
The ADT tile y coordinate.
Definition records.hpp:26
std::uint16_t tileY
The ADT tile y coordinate.
Definition records.hpp:67
std::int16_t textureIndex
Index into MTEX, or -1.
Definition records.hpp:73
std::int16_t mltaIndex
Index into MLTA, or -1 when unanimated.
Definition records.hpp:70
float attenuationStart
Where the light's spread starts; usually 0.
Definition records.hpp:52
float attenuationEnd
How far the light spreads.
Definition records.hpp:55
CImVector color
Light color (b, g, r, a); alpha 0 means fully opaque.
Definition records.hpp:46
C3Vector rotation
Rotation; usually zero for point lights.
Definition records.hpp:61
std::uint16_t tileX
The ADT tile x coordinate.
Definition records.hpp:64
float attenuationEnd
How far the light spreads.
Definition records.hpp:137
std::int16_t mltaIndex
Index into MLTA, or -1 when unanimated.
Definition records.hpp:161
std::uint16_t tileX
The ADT tile x coordinate.
Definition records.hpp:155
float outerAngle
Outer cone angle, radians.
Definition records.hpp:152
CImVector color
Light color (b, g, r, a); alpha 0 means fully opaque.
Definition records.hpp:128
std::int16_t textureIndex
Index into MTEX, or -1.
Definition records.hpp:164
std::uint16_t tileY
The ADT tile y coordinate.
Definition records.hpp:158
float attenuationStart
Where the light's spread starts; must be <= attenuation_end.
Definition records.hpp:134
float innerAngle
Inner cone angle, radians.
Definition records.hpp:149
The binary-level math and color primitives shared across WoW file formats (wowdev....