MapEntity
struct · terrain · 264 bytes
- Vtable
0x810810- Meaning
- Holds a map light node: the light of a unit, player, game object, missile or effect, and its model
- Confidence
- verified, proof one
- Finding
- terrain/mapentities#light-node-classes
Finding: Light node classes in terrain: map entities
Two classes share the map light base. The entity node (vtable 0x810810, 0x69d590, 0x108 bytes) is
the light of units, players, game objects, missiles and effects; the doodad def (0x810a74, 0x6a7d00,
0x198 bytes) is the light of placed doodads. They differ in slots 2 (0x6a7300, 0x6a8050) and 4
(0x69e4c0, 0x6a8410), and on a def +0xf8 is m[2][3] of the matrix at +0xcc, not a target. An entity node's sun
scale +0xa4 ramps at 3.3333 per second toward its target +0xf8: 2.5 lit, 0.5 shadowed, 1.0 interior. A def's
is assigned: 1.0 at creation, 0.5 once if the pending drain finds it in shadow, never ramped.
The derivation is in the doc.
Fields 7
| offset | size | type | name | meaning | confidence | finding |
|---|---|---|---|---|---|---|
0x000c | 2 | uint16_t | m_lightFlags | Holds the light word: 1 gathers map object lights, 2 lit as an interior, 4 lit by the sun, 0x200 on a map object | verified, proof one | terrain/lights#entity-lighting |
0x0024 | 12 | float[3] | m_position | Holds the node position, 1.0e7 on each axis from the creator until the first sync | verified, proof one | terrain/mapentities#unit-light-node-lifecycle |
0x0088 | 4 | CM2Model * | m_model | Holds the model the node lights, with a reference | verified, proof one | terrain/lights#unit-model-light-callback |
0x00a4 | 4 | float | m_intensity | Holds the intensity: 1.0 from the creator, stepped toward +0xf8; 0x6a7300 scales the sun or the +0xa0 colour by it | verified, proof two | terrain/mapentities#unit-light-node-lifecycle |
0x00b4 | 4 | void * | m_drawCallback | Holds the callback the entity draw calls each frame | verified, proof one | objectlayer/createpose#create-order |
0x00b8 | 4 | void * | m_drawCallbackArg | Holds the draw callback's argument | verified, proof one | terrain/lights#unit-model-light-callback |
0x00f8 | 4 | float | m_intensityTarget | Holds the intensity target: 2.5 lit, 0.5 shadowed, 1.0 as an interior or from the creator | verified, proof two | terrain/mapentities#unit-light-node-lifecycle |