wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
light.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <array>
7#include <cstdint>
8#include <utility>
9
10#include <welder/vocabulary.hpp>
11
16
18 // --- MOLP / MLSS / MLSP / MLSK / MOP2 ---------------------------------------
19
20 struct [[
21 =welder::weld,
22 =welder::doc("One MOLP point light (Legion+).")
24 [[=welder::doc("Unknown; preserved for round-trip.")]]
25 std::uint32_t unknown1 = 0;
27 [[=welder::doc("Light color.")]]
30 [[=welder::doc("Position of the light.")]]
33 [[=welder::doc("Intensity.")]]
34 float intensity = 0;
36 [[=welder::doc("Attenuation start distance.")]]
37 float attenStart = 0;
39 [[=welder::doc("Attenuation end distance.")]]
40 float attenEnd = 0;
42 [[=welder::doc("Unknown; only zeros observed.")]]
43 float unknown2 = 0;
45 [[=welder::doc("Unknown; preserved for round-trip.")]]
46 std::uint32_t unknown3 = 0;
48 [[=welder::doc("Unknown; possibly a color.")]]
49 std::uint32_t unknown4 = 0;
50 };
51
52 static_assert(sizeof(PointLight) == 0x2C);
53
54 struct [[
55 =welder::weld,
56 =welder::doc(R"(
57 One light-set range (8.1+): a (first, count) window into the group's
58 spot lights (MLSS -> MOLS), point lights (MLSP -> MOLP) or point-light
59 animations (MLSK -> MOP2).)")
60 ]] LightSet {
61 [[=welder::doc("First light in the referenced chunk.")]]
62 std::uint32_t offset = 0;
64 [[=welder::doc("Number of lights in the set.")]]
65 std::uint32_t count = 0;
66 };
67
68 static_assert(sizeof(LightSet) == 0x8);
69
70 struct [[
71 =welder::weld,
72 =welder::doc(
73 "One MOP2 entry (8.1+): an animated point light with flicker "
74 "and light-cookie texture data.")
76 [[=welder::doc("Index of the light this animation belongs to.")]]
77 std::uint32_t lightIndex = 0;
78
79 [[=welder::doc("Light color.")]]
81
82 [[=welder::doc("Position of the light.")]]
84
85 [[=welder::doc("Attenuation start distance.")]]
86 float attenStart = 0;
87
88 [[=welder::doc("Attenuation end distance.")]]
89 float attenEnd = 0;
90
91 [[=welder::doc("Intensity.")]]
92 float intensity = 0;
93
94 [[=welder::doc("Euler rotation in radians.")]]
96
97 [[=welder::doc("Flickering intensity.")]]
98 float flickerIntensity = 0;
99
100 [[=welder::doc("Flickering speed.")]]
101 float flickerSpeed = 0;
102
103 [[=welder::doc("0 = off, 1 = sine curve, 2 = noise curve, 3 = noise step.")]
104 ]
105 std::int32_t flickerMode = 0;
106
108 [[=welder::mark::exclude]] std::array<std::int32_t, 4> unknown{};
109
110 [[=welder::doc("FileDataID of the light cookie texture.")]]
111 std::uint32_t lightTextureFdid = 0;
112
114 [[=welder::mark::exclude]] std::array<std::int32_t, 5> unknown2{};
115 };
116
117 static_assert(sizeof(PointLightAnim) == 0x60);
118
119 // v14-alpha-only chunks (MOLM/MOLD lightmaps, MOIN indices, the old MOLV
120 // lightmap texcoords, and the never-read MPB* set) predate every supported
121 // client version and are not modeled; they would round-trip through
122 // ChunkExtras::unknown if ever encountered. MLSO/MOS2 exist in client
123 // binaries only, never in files.
124}
Client version identity, the flavor axis that separates a client's CONTENT version from the engine ge...
Flag-testing convenience for the binary formats' bit-mask enums.
WMO group-file chunk binary structs (the MOGP header, render batches, BSP nodes, group lights) and th...
Definition geometry.hpp:18
A 3D float vector — the workhorse: positions, normals, rotations-as-Euler-degrees in placements.
Definition types.hpp:49
A color stored as b, g, r, a bytes — the client's immediate-mode vertex color layout (WMO MOCV,...
Definition types.hpp:178
std::uint32_t offset
First light in the referenced chunk.
Definition light.hpp:54
std::uint32_t count
Number of lights in the set.
Definition light.hpp:57
One MOP2 entry (8.1+): an animated point light with flicker and light-cookie texture data.
Definition light.hpp:63
C3Vector rotation
Euler rotation in radians.
Definition light.hpp:83
float attenEnd
Attenuation end distance.
Definition light.hpp:77
C3Vector position
Position of the light.
Definition light.hpp:71
float attenStart
Attenuation start distance.
Definition light.hpp:74
std::uint32_t lightIndex
Index of the light this animation belongs to.
Definition light.hpp:65
float flickerIntensity
Flickering intensity.
Definition light.hpp:86
One MOLP point light (Legion+).
Definition light.hpp:21
std::uint32_t unknown1
Unknown; preserved for round-trip.
Definition light.hpp:23
C3Vector position
Position of the light.
Definition light.hpp:29
std::uint32_t unknown3
Unknown; preserved for round-trip.
Definition light.hpp:44
float unknown2
Unknown; only zeros observed.
Definition light.hpp:41
float attenEnd
Attenuation end distance.
Definition light.hpp:38
float attenStart
Attenuation start distance.
Definition light.hpp:35
std::uint32_t unknown4
Unknown; possibly a color.
Definition light.hpp:47
The binary-level math and color primitives shared across WoW file formats (wowdev....
WMO version pivots that change a binary-struct layout (not just chunk presence).