benilla-re systems structs docs

M2Scene

struct · models · 7532 bytes

Meaning
Holds a scene: clock, model lists, light grid, elements, draw lists and queued callbacks
Confidence
verified, proof one
Finding
models/scene#scene-object

Finding: Scene object in models: the scene

The constructor stores the cache at +0x4, sets the reference count +0x0 to 1, the view +0x9c and the scene matrix +0xdc to identity, and the 1800-entry shader id memo at +0x14c to −1. 0x707320 decrements the count and destroys and frees the scene at zero; the destructor releases every instance on the model list +0x8, then frees the element, sort and callback arrays.

offsetholds
+0x00cclock, milliseconds
+0x010frame counter
+0x018, +0x01cglobal light list, 64×64 light grid
+0x020animate list (link +0x44/+0x48 in the instance)
+0x024, +0x028draw queue, emitter queue (links +0x54/+0x58, +0x3dc/+0x3e0)
+0x02c to +0x034element array (64-byte M2Element)
+0x03c, +0x04c, +0x05c, +0x06cgrouped list, list 0, list 1, list 2 (index arrays)
+0x07c to +0x088queued callbacks (48-byte records)
+0x11c, +0x120special-batch callback and its argument

The derivation is in the doc.

Fields 9

offsetsizetypenamemeaningconfidencefinding
0x00004uint32_tm_refCountHolds the scene's reference countverified, proof onemodels/scene#scene-object
0x00044M2Cache *m_cacheHolds the cache the scene belongs toverified, proof onemodels/scene#scene-object
0x000c4uint32_tm_timeHolds the scene clock in millisecondsverified, proof onemodels/scene#scene-object
0x00104uint32_tm_frameHolds the frame counter the collect pass incrementsverified, proof onemodels/scene#scene-object
0x00204CM2Model *m_animateListHolds the first instance of the animate listverified, proof onemodels/scene#scene-object
0x009c64float[16]m_viewHolds the view matrix, rebased to the frame originverified, proof onemodels/scene#scene-object
0x00dc64float[16]m_sceneMatrixHolds the matrix the scene derives from its viewverified, proof onemodels/scene#scene-object
0x01248void *[2]m_groundCallbackHolds the ground height callback and its argumentverified, proof onemodels/emission#spawn-space
0x014c7200uint32_t[1800]m_shaderIdMemoHolds the remapped vertex shader ids, -1 when not computedverified, proof onemodels/scene#scene-object