Returns specific element from entity world transformation matrix (4x4, row 0-3, column 0-3).
Takes entity (entity handle), row (matrix row index 0-3), column (matrix column index 0-3).
Returns matrix element value (Double), or 0.0 if invalid entity or out-of-range row/column.
3D Graphics
Parameters & Returns
Parameters
entityInt
rowInt
columnInt
Returns
Double
Quick Summary
Returns specific element from entity world transformation matrix (4x4, row 0-3, column 0-3).
Takes entity (entity handle), row (matrix row index 0-3), column (matrix column index 0-3).
Returns matrix element value (Double), or 0.0 if invalid entity or out-of-range row/column.
Technical Exegesis...
Returns specific element from entity world transformation matrix (4x4, row 0-3, column 0-3). Takes entity (entity handle), row (matrix row index 0-3), column (matrix column index 0-3). Returns matrix element value (Double), or 0.0 if invalid entity or out-of-range row/column. Validates entity exists and row/column in [0,3] range, builds world matrix (scale * rotation * translation), returns matrix element at [row][column], negates Y translation (row=3, column=1) back to user space.
Returns specific element from entity world transformation matrix (4x4, row 0-3, column 0-3). Takes entity (entity handle), row (matrix row index 0-3), column (matrix column index 0-3). Returns matrix element value (Double), or 0.0 if invalid entity or out-of-range row/column. Validates entity exists and row/column in [0,3] range, builds world matrix (scale * rotation * translation), returns matrix element at [row][column], negates Y translation (row=3, column=1) back to user space. Direct matrix element access.
This function accesses transformation matrix. Matrix structure: 4x4 world transformation matrix, row-major order (DirectXMath convention), matrix = scale * rotation * translation, row 0-2 contain rotation/scale, row 3 contains translation [tx, ty, tz, 1]. Matrix layout: row 0 = right vector + X scale (column 0-2) + 0 (column 3), row 1 = up vector + Y scale (column 0-2) + 0 (column 3), row 2 = forward vector + Z scale (column 0-2) + 0 (column 3), row 3 = translation (column 0=tx, column 1=ty, column 2=tz, column 3=1). Translation elements: row=3, column=0 is X position, row=3, column=1 is Y position (negated to user space), row=3, column=2 is Z position, row=3, column=3 is 1.0. Rotation/scale elements: rows 0-2, columns 0-2 contain combined rotation and scale (right/up/forward vectors scaled by entity scale). Use cases: (1) Extract position (row=3, columns 0-2 for X/Y/Z), (2) Extract direction vectors (row 0-2 for right/up/forward), (3) Custom transforms (use matrix elements for manual calculations), (4) Debug visualization (inspect matrix values), (5) Advanced users (direct matrix access for special cases). Common patterns: get world X b3dGetMatElement(entity, 3, 0), get world Y b3dGetMatElement(entity, 3, 1), get world Z b3dGetMatElement(entity, 3, 2). Typical usage: extract translation components directly (alternative to b3dEntityX/Y/Z), extract direction vectors for custom transforms. Y-axis negation: only translation Y (row=3, column=1) negated from internal -Y to user +Y, other elements raw values from matrix. Validation: returns 0.0 if entity invalid or row/column out of [0,3] range. Matrix rebuild: builds matrix fresh each call (not cached, includes current position/rotation/scale). Performance: O(1) matrix construction and lookup (fast, suitable for occasional queries, don't call per-frame for many entities). Related: b3dEntityX/Y/Z retrieve position (simpler than GetMatElement row=3), b3dTFormVector retrieves direction vectors (simpler than extracting rotation columns).