M2Light
struct · models · 108 bytes
- Meaning
- Holds a light: type, position, direction, colours, attenuation and scene link
- Confidence
- verified, proof one
- Finding
- models/lights#light-object
Finding: Light object in models: lights
0x71b4a0 initializes a light: type 1 (point), zero position, direction and colours, attenuation
0.7 at +0x58 and 0.03 at +0x5c, disabled and unlinked. A light belongs to a scene (+0x0,
with the scene's frame minus one at +0x4); setting its type or position relinks an enabled
point light, and enabling links it.
| offset | holds |
|---|---|
+0x008 | type: 1 point, other values directional |
+0x00c | position |
+0x024 | direction, normalized unless shorter than 2.384186e-7 |
+0x030, +0x03c, +0x048 | ambient, diffuse and third colour |
+0x060 | enabled |
+0x064, +0x068 | link: address of the previous link, next light |
The derivation is in the doc.
Fields 15
| offset | size | type | name | meaning | confidence | finding |
|---|---|---|---|---|---|---|
0x0000 | 4 | M2Scene * | m_scene | Holds the scene the light belongs to | verified, proof one | models/lights#light-object |
0x0004 | 4 | uint32_t | m_frame | Holds the scene frame the light was last placed in; a grid light with an older stamp is disabled | verified, proof one | models/lights#scene-light-grid |
0x0008 | 4 | uint32_t | m_type | Holds the light type, 1 for a point light | verified, proof one | models/lights#light-object |
0x000c | 12 | float[3] | m_position | Holds the light position | verified, proof one | models/lights#light-object |
0x0018 | 12 | float[3] | m_viewPosition | Holds the light position in view space, for the nearest lights of a record | verified, proof one | models/lights#view-space-lights |
0x0024 | 12 | float[3] | m_direction | Holds the light direction | verified, proof one | models/lights#light-object |
0x0030 | 12 | float[3] | m_ambient | Holds the ambient colour | verified, proof one | models/lights#model-light-tracks |
0x003c | 12 | float[3] | m_diffuse | Holds the diffuse colour | verified, proof one | models/lights#model-light-tracks |
0x0048 | 12 | float[3] | m_third | Holds the third colour, summed apart from ambient and diffuse | verified, proof one | models/lights#adding-a-light |
0x0054 | 4 | float | m_attenuation0 | Holds the first attenuation term, 0 by default | verified, proof one | models/lights#model-light-tracks |
0x0058 | 4 | float | m_attenuation1 | Holds the second attenuation term, 0.7 by default | verified, proof one | models/lights#model-light-tracks |
0x005c | 4 | float | m_attenuation2 | Holds the third attenuation term, 0.03 by default | verified, proof one | models/lights#model-light-tracks |
0x0060 | 4 | uint32_t | m_enabled | Holds whether the light is enabled | verified, proof one | models/lights#light-object |
0x0064 | 4 | M2Light ** | m_linkPrev | Holds the address of the link that points at the light | verified, proof one | models/lights#light-object |
0x0068 | 4 | M2Light * | m_linkNext | Holds the next light in the same list or cell | verified, proof one | models/lights#light-object |