Transforms point from src_entity space to dest_entity space (stores in g_lastTFormedResult, retrieve with b3dTFormedX/Y/Z).
Takes x/y/z (point coordinates in src space), src_entity (source coordinate system, 0=world space), dest_entity (destination coordinate system, 0=world space).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
xDouble
yDouble
zDouble
src_entityInt
dest_entityInt
Returns
Void
Quick Summary
Transforms point from src_entity space to dest_entity space (stores in g_lastTFormedResult, retrieve with b3dTFormedX/Y/Z).
Takes x/y/z (point coordinates in src space), src_entity (source coordinate system, 0=world space), dest_entity (destination coordinate system, 0=world space).
Returns nothing.
Technical Exegesis...
Transforms point from src_entity space to dest_entity space (stores in g_lastTFormedResult, retrieve with b3dTFormedX/Y/Z). Takes x/y/z (point coordinates in src space), src_entity (source coordinate system, 0=world space), dest_entity (destination coordinate system, 0=world space). Returns nothing.
Transforms point from src_entity space to dest_entity space (stores in g_lastTFormedResult, retrieve with b3dTFormedX/Y/Z). Takes x/y/z (point coordinates in src space), src_entity (source coordinate system, 0=world space), dest_entity (destination coordinate system, 0=world space). Returns nothing. Negates input Y (user +Y to internal -Y), builds src transform matrix (scale * rotation * translation), builds dest inverse transform matrix, transforms point from src to world to dest space, negates output Y (internal -Y to user +Y), stores in g_lastTFormedResult. Coordinate system conversion for positions.
This function transforms positions. Point transformation: uses XMVector3TransformCoord (transforms position with translation), applies full transform (scale, rotation, translation), use for object positions (not directions). Transform pipeline: (1) Input point in src space, (2) Negate Y (user to internal), (3) Transform to world space (multiply by src matrix), (4) Transform to dest space (multiply by dest inverse matrix), (5) Negate Y (internal to user), (6) Store result. Coordinate systems: src_entity=0 means world space (identity matrix), dest_entity=0 means world space (identity matrix), otherwise uses entity's scale/rotation/translation. Use cases: (1) Local to world (convert entity-relative position to world coords, src=entity dest=0), (2) World to local (convert world position to entity-relative coords, src=0 dest=entity), (3) Entity to entity (convert position between two entity spaces, useful for attachments), (4) Projectile spawning (convert gun barrel local offset to world position), (5) IK systems (transform bone positions between coordinate systems). Common patterns: local to world b3dTFormPoint(0,1,0, entity, 0) converts local up to world position, world to local b3dTFormPoint(worldX, worldY, worldZ, 0, entity) converts world pos to entity-local. Typical usage: convert attachment point from local to world (weapon muzzle flash position), convert world position to local for UI anchors, convert between bone spaces for animation. Y-axis negation: input/output in user space (+Y up), internal calculations in DirectX space (-Y up), automatic negation both directions. Matrix construction: src matrix = scale * rotation * translation (YXZ rotation order), dest inverse = inverse(scale * rotation * translation), matches GPU shader transform. Result retrieval: call b3dTFormedX/Y/Z() to get transformed coordinates. Performance: O(1) matrix math (few multiplies, one inversion), very fast, suitable for per-frame transforms. Invalid entities: src_entity or dest_entity=0 treated as world space (identity matrix), invalid handles use identity (no transform). Related: b3dTFormVector transforms directions (no translation), b3dTFormNormal transforms normals (normalized), b3dTFormedX/Y/Z retrieve transformed result.