Moves entity in local space (relative to orientation, forward/strafe/up movement).
Takes entity (entity handle), x (right/left distance), y (up/down distance - positive up), z (forward/backward distance).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityInt
xDouble
yDouble
zDouble
Returns
Void
Quick Summary
Moves entity in local space (relative to orientation, forward/strafe/up movement).
Takes entity (entity handle), x (right/left distance), y (up/down distance - positive up), z (forward/backward distance).
Returns nothing.
Technical Exegesis...
Moves entity in local space (relative to orientation, forward/strafe/up movement). Takes entity (entity handle), x (right/left distance), y (up/down distance - positive up), z (forward/backward distance). Returns nothing. Validates entity exists, converts rotation to radians, builds rotation matrix, transforms movement vector from local to world space with Y-axis negation, if physicsBodyHandle!=0 routes to b3dSetPhysicsBodyPosition (calculates new position, converts coordinates), otherwise updates entity.
Moves entity in local space (relative to orientation, forward/strafe/up movement). Takes entity (entity handle), x (right/left distance), y (up/down distance - positive up), z (forward/backward distance). Returns nothing. Validates entity exists, converts rotation to radians, builds rotation matrix, transforms movement vector from local to world space with Y-axis negation, if physicsBodyHandle!=0 routes to b3dSetPhysicsBodyPosition (calculates new position, converts coordinates), otherwise updates entity.position directly. Local-space movement relative to entity orientation.
This function moves entity along its own axes (not world axes). Local vs world space: MoveEntity uses entity's local axes (x=entity's right, y=entity's up, z=entity's forward), movement rotates with entity (forward always moves in facing direction), contrast with b3dTranslateEntity which moves in world axes (always same direction regardless of orientation). Rotation matrix transformation: converts entity.rotation (pitch/yaw/roll degrees) to radians, builds rotation matrix: rotationMatrix = XMMatrixRotationRollPitchYaw(pitchRad, yawRad, rollRad), transforms local movement vector: localMove = (x, -y, z) with Y negation, globalMove = XMVector3Transform(localMove, rotationMatrix), result is world-space movement amount. Y-axis negation: user +Y=up, internal -Y=up, movement vector negates Y: localMove = XMVECTOR(x, -y, z), maintains coordinate system consistency. Physics integration: checks entity.physicsBodyHandle!=0, if physics body present: calculates new position = entity.position + moveAmount (entity.position synced from physics, current position), converts to user coordinates (newX, -newY, newZ), calls b3dSetPhysicsBodyPosition with user coords, physics system owns position. If no physics body: updates entity.position directly (position.x += moveAmount.x, position.y += moveAmount.y, position.z += moveAmount.z), marks worldMatrixDirty=true. Use cases: (1) First-person camera movement (forward/back/strafe), (2) Vehicle movement (accelerate forward, turn), (3) Character movement (walk in facing direction), (4) Flight simulation (pitch/roll movement), (5) Space navigation (6-DOF movement). Common pattern: b3dMoveEntity(player, 0, 0, speed) moves forward (Z-axis), b3dMoveEntity(player, speed, 0, 0) strafes right (X-axis), b3dMoveEntity(player, 0, speed, 0) moves up (Y-axis). Coordinate axes: X=right (positive right, negative left), Y=up (positive up, negative down in user space), Z=forward (positive forward, negative backward). Rotation dependency: movement direction depends on entity rotation (rotated entity moves in different world direction), use b3dTranslateEntity for world-space movement (ignores rotation). Typical usage: poll input (WASD keys), calculate movement vector, call b3dMoveEntity every frame for smooth motion, combine with b3dTurnEntity for rotation. Performance: rotation matrix calculation per call (relatively fast, uses DirectX Math), physics routing more expensive than direct position update. Related: b3dTranslateEntity moves in world space (ignores orientation), b3dPositionEntity sets absolute position, b3dTurnEntity rotates entity, b3dSetPhysicsBodyPosition for physics-driven positioning.