BBMOD
Transforms and Coordinate Space
Use the current physics pose to position a BBMOD model.
The public world convention remains Z-up. No coordinate conversion changed during retirement.
model_matrix_from_transform(position, rotation, scale=undefined)Position uses {x,y,z}; rotation uses {x,y,z,w}. The helper normalizes the quaternion; a near-zero quaternion becomes identity. Scale defaults to {x:1,y:1,z:1}. It performs no asset-axis conversion.
var pose = body.get_transform();
render_instance.Matrix = model_matrix_from_transform(pose.position, pose.rotation);Keep the model origin aligned with the physics origin, or compose an explicit local visual offset. The helper only computes a matrix and allocates no physics or GPU resources.
New related workflows#
Verified operation contracts#
These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.
| Symbol / owner | Signature | Operation contract |
|---|---|---|
| model_matrix_from_transform | model_matrix_from_transform(position,rotation,scale=undefined) | Position XYZ struct, rotation XYZW quaternion, optional scale XYZ default 1 →16-number GameMaker matrix. Normalizes quaternion, replaces near-zero with identity. Does not validate missing structs:check getter results first; an XYZ normal is not a quaternion. |