benilla-re systems structs docs

CM2Model

struct · models · 1064 bytes

Meaning
Holds a model instance: its scene, shared model, transforms, animation state and children
Confidence
verified, proof one
Finding
models/model#instance-object

Finding: Instance object in models: the instance

The constructor sets the reference count to 1, the base, world and transport matrices to identity, the diffuse multiplier to (1, 1, 1), the depth-fill flag and the two loaded-children flags to 1, and picks the skinning routine. Initialize links the instance to its scene, adds a reference to the shared model and, for a copy, to the source instance, and attaches a new instance of each of the source's children at the same attachment id.

offsetholds
+0x010, +0x014loaded, textures loaded
+0x02c, +0x030, +0x034scene, shared model, copy source
+0x038, +0x03cdeferred call queue: head, address of the tail link
+0x040frame of the last animation
+0x090, +0x094bone states (0x118 each), bone matrices (64 bytes each)
+0x0bc, +0x0fc, +0x13cbase matrix, world matrix, transport matrix
+0x180, +0x184, +0x190alpha, diffuse multiplier, emissive colour
+0x1cc, +0x1d0, +0x1d4parent, attachment id, attachment index in the parent
+0x1dc, +0x1e4first child, next sibling
+0x3b8lighting record in use

The derivation is in the doc.

Fields 31

offsetsizetypenamemeaningconfidencefinding
0x00004uint32_tm_refCountHolds the instance's reference countverified, proof onemodels/model#instance-object
0x00104uint32_tm_loadedHolds 1 once the instance's state is builtverified, proof onemodels/model#instance-object
0x00144uint32_tm_texturesLoadedHolds 1 once the instance's textures are loadedverified, proof onemodels/model#instance-object
0x002c4M2Scene *m_sceneHolds the scene the instance belongs toverified, proof onemodels/model#instance-object
0x00304CM2Shared *m_sharedHolds the shared model of the instance's fileverified, proof onemodels/model#instance-object
0x00344CM2Model *m_copySourceHolds the instance copied from, until the load endsverified, proof onemodels/model#instance-object
0x00384void *m_deferredHeadHolds the first deferred call recordverified, proof onemodels/model#instance-object
0x003c4void *m_deferredTailHolds the address of the deferred queue's tail linkverified, proof onemodels/model#instance-object
0x00404uint32_tm_animatedFrameHolds the scene frame the instance last animated inverified, proof onemodels/model#instance-object
0x00704void *m_doneCallbackHolds the animation-done callback, or nullverified, proof oneanimation/hosts#doodad-model
0x00784uint32_tm_doneArg1Holds the first stored argument the done callback is called withverified, proof oneanimation/hosts#doodad-model
0x007c4uint32_tm_doneArg2Holds the second stored argument the done callback is called withverified, proof oneanimation/hosts#doodad-model
0x00904void *m_boneStatesHolds the bone states, 0x118 bytes eachverified, proof onemodels/model#instance-object
0x00944void *m_boneMatricesHolds the bone matrices, 64 bytes eachverified, proof onemodels/model#instance-object
0x00bc64float[16]m_baseMatrixHolds the instance's base matrixverified, proof onemodels/model#instance-object
0x00fc64float[16]m_worldMatrixHolds the instance's world matrixverified, proof onemodels/model#instance-object
0x013c64float[16]m_transportMatrixHolds the copied transport matrix the reference frame points atverified, proof onemodels/model#reference-frame
0x017c4float *m_referenceFrameHolds the reference frame, the transport matrix, or nullverified, proof onemodels/model#reference-frame
0x01804floatm_alphaHolds the instance alphaverified, proof onemodels/model#instance-object
0x018412float[3]m_diffuseHolds the diffuse colour multiplierverified, proof onemodels/model#instance-object
0x019012float[3]m_emissiveHolds the emissive colourverified, proof onemodels/model#instance-object
0x01cc4CM2Model *m_parentHolds the instance this one is attached toverified, proof onemodels/model#instance-object
0x01d04uint32_tm_attachIdHolds the attachment id it is attached atverified, proof onemodels/model#instance-object
0x01d44uint32_tm_attachIndexHolds the attachment index in the parent, 0xffff while unresolvedverified, proof onemodels/model#instance-object
0x01dc4CM2Model *m_firstChildHolds the first attached instanceverified, proof onemodels/model#instance-object
0x01e44CM2Model *m_nextSiblingHolds the next instance attached to the same parentverified, proof onemodels/model#instance-object
0x03b84M2Lighting *m_lightingHolds the lighting record the instance draws withverified, proof onemodels/model#instance-object
0x03bc4void *m_lightingCallbackHolds the callback that adds to the instance lighting recordverified, proof onemodels/model#instance-setters
0x03c04void *m_lightingArgHolds the lighting callback argumentverified, proof onemodels/model#instance-setters
0x03c44void *m_cameraStatesHolds the camera states, 0x84 bytes each with the camera at +0x80verified, proof onemodels/model#key-bones-and-cameras
0x03ec4M2TextureUnit *m_ownUnitsHolds the instance's own batch table: whole copies of the first unit of each run it keepsverified, proof twomodels/records#texture-unit-layer