wowlib
0.0.0
Read & write World of Warcraft client files — a C++26 core
Toggle main menu visibility
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
12
#include <
wowlib/core/client_version.hpp
>
13
#include <
wowlib/formats/common/flags.hpp
>
14
#include <
wowlib/formats/common/types.hpp
>
15
#include <
wowlib/formats/wmo/boundaries.hpp
>
16
17
namespace
wowlib::formats::wmo::group::chunks
{
18
// --- MOLP / MLSS / MLSP / MLSK / MOP2 ---------------------------------------
19
20
struct
[[
21
=welder::weld,
22
=welder::doc(
"One MOLP point light (Legion+)."
)
23
]]
PointLight
{
24
[[=welder::doc(
"Unknown; preserved for round-trip."
)]]
25
std::uint32_t
unknown1
= 0;
26
27
[[=welder::doc(
"Light color."
)]]
28
CImVector
color
{};
29
30
[[=welder::doc(
"Position of the light."
)]]
31
C3Vector
position
{};
32
33
[[=welder::doc(
"Intensity."
)]]
34
float
intensity
= 0;
35
36
[[=welder::doc(
"Attenuation start distance."
)]]
37
float
attenStart
= 0;
38
39
[[=welder::doc(
"Attenuation end distance."
)]]
40
float
attenEnd
= 0;
41
42
[[=welder::doc(
"Unknown; only zeros observed."
)]]
43
float
unknown2
= 0;
44
45
[[=welder::doc(
"Unknown; preserved for round-trip."
)]]
46
std::uint32_t
unknown3
= 0;
47
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;
63
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."
)
75
]]
PointLightAnim
{
76
[[=welder::doc(
"Index of the light this animation belongs to."
)]]
77
std::uint32_t
lightIndex
= 0;
78
79
[[=welder::doc(
"Light color."
)]]
80
CImVector
color
{};
81
82
[[=welder::doc(
"Position of the light."
)]]
83
C3Vector
position
{};
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."
)]]
95
C3Vector
rotation
{};
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.hpp
Client version identity, the flavor axis that separates a client's CONTENT version from the engine ge...
flags.hpp
Flag-testing convenience for the binary formats' bit-mask enums.
wowlib::formats::wmo::group::chunks
WMO group-file chunk binary structs (the MOGP header, render batches, BSP nodes, group lights) and th...
Definition
geometry.hpp:18
wowlib::formats::common::C3Vector
A 3D float vector — the workhorse: positions, normals, rotations-as-Euler-degrees in placements.
Definition
types.hpp:49
wowlib::formats::common::CImVector
A color stored as b, g, r, a bytes — the client's immediate-mode vertex color layout (WMO MOCV,...
Definition
types.hpp:178
wowlib::formats::wmo::group::chunks::LightSet
Definition
light.hpp:52
wowlib::formats::wmo::group::chunks::LightSet::offset
std::uint32_t offset
First light in the referenced chunk.
Definition
light.hpp:54
wowlib::formats::wmo::group::chunks::LightSet::count
std::uint32_t count
Number of lights in the set.
Definition
light.hpp:57
wowlib::formats::wmo::group::chunks::PointLightAnim
One MOP2 entry (8.1+): an animated point light with flicker and light-cookie texture data.
Definition
light.hpp:63
wowlib::formats::wmo::group::chunks::PointLightAnim::color
CImVector color
Light color.
Definition
light.hpp:68
wowlib::formats::wmo::group::chunks::PointLightAnim::rotation
C3Vector rotation
Euler rotation in radians.
Definition
light.hpp:83
wowlib::formats::wmo::group::chunks::PointLightAnim::intensity
float intensity
Intensity.
Definition
light.hpp:80
wowlib::formats::wmo::group::chunks::PointLightAnim::attenEnd
float attenEnd
Attenuation end distance.
Definition
light.hpp:77
wowlib::formats::wmo::group::chunks::PointLightAnim::position
C3Vector position
Position of the light.
Definition
light.hpp:71
wowlib::formats::wmo::group::chunks::PointLightAnim::attenStart
float attenStart
Attenuation start distance.
Definition
light.hpp:74
wowlib::formats::wmo::group::chunks::PointLightAnim::flickerSpeed
float flickerSpeed
Flickering speed.
Definition
light.hpp:89
wowlib::formats::wmo::group::chunks::PointLightAnim::lightIndex
std::uint32_t lightIndex
Index of the light this animation belongs to.
Definition
light.hpp:65
wowlib::formats::wmo::group::chunks::PointLightAnim::flickerIntensity
float flickerIntensity
Flickering intensity.
Definition
light.hpp:86
wowlib::formats::wmo::group::chunks::PointLight
One MOLP point light (Legion+).
Definition
light.hpp:21
wowlib::formats::wmo::group::chunks::PointLight::intensity
float intensity
Intensity.
Definition
light.hpp:32
wowlib::formats::wmo::group::chunks::PointLight::unknown1
std::uint32_t unknown1
Unknown; preserved for round-trip.
Definition
light.hpp:23
wowlib::formats::wmo::group::chunks::PointLight::color
CImVector color
Light color.
Definition
light.hpp:26
wowlib::formats::wmo::group::chunks::PointLight::position
C3Vector position
Position of the light.
Definition
light.hpp:29
wowlib::formats::wmo::group::chunks::PointLight::unknown3
std::uint32_t unknown3
Unknown; preserved for round-trip.
Definition
light.hpp:44
wowlib::formats::wmo::group::chunks::PointLight::unknown2
float unknown2
Unknown; only zeros observed.
Definition
light.hpp:41
wowlib::formats::wmo::group::chunks::PointLight::attenEnd
float attenEnd
Attenuation end distance.
Definition
light.hpp:38
wowlib::formats::wmo::group::chunks::PointLight::attenStart
float attenStart
Attenuation start distance.
Definition
light.hpp:35
wowlib::formats::wmo::group::chunks::PointLight::unknown4
std::uint32_t unknown4
Unknown; possibly a color.
Definition
light.hpp:47
types.hpp
The binary-level math and color primitives shared across WoW file formats (wowdev....
boundaries.hpp
WMO version pivots that change a binary-struct layout (not just chunk presence).
src
wowlib
formats
wmo
group
chunks
light.hpp
Generated by
1.17.0