Rotates entity by relative angles (adds to current rotation, incremental turn).
Takes entity (entity handle), pitch (pitch delta in degrees), yaw (yaw delta in degrees), roll (roll delta in degrees).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityInt
pitchDouble
yawDouble
rollDouble
Returns
Void
Quick Summary
Rotates entity by relative angles (adds to current rotation, incremental turn).
Takes entity (entity handle), pitch (pitch delta in degrees), yaw (yaw delta in degrees), roll (roll delta in degrees).
Returns nothing.
Technical Exegesis...
Rotates entity by relative angles (adds to current rotation, incremental turn). Takes entity (entity handle), pitch (pitch delta in degrees), yaw (yaw delta in degrees), roll (roll delta in degrees). Returns nothing. Validates entity exists, if physicsBodyHandle!=0 calculates new rotation (current + delta) and routes to b3dSetPhysicsBodyRotation, otherwise adds deltas to entity.rotation and marks worldMatrixDirty=true. Relative rotation (incremental, not absolute).
Rotates entity by relative angles (adds to current rotation, incremental turn). Takes entity (entity handle), pitch (pitch delta in degrees), yaw (yaw delta in degrees), roll (roll delta in degrees). Returns nothing. Validates entity exists, if physicsBodyHandle!=0 calculates new rotation (current + delta) and routes to b3dSetPhysicsBodyRotation, otherwise adds deltas to entity.rotation and marks worldMatrixDirty=true. Relative rotation (incremental, not absolute).
This function applies incremental rotation to entity. Relative vs absolute: TurnEntity adds to current rotation (relative, incremental), contrast with b3dRotateEntity which sets absolute rotation (replaces current rotation). Calculation: newPitch = currentPitch + pitch, newYaw = currentYaw + yaw, newRoll = currentRoll + roll. Continuous rotation: call every frame for spinning/rotating animations (turntable, spinning projectile, rotating platform). Physics integration: checks entity.physicsBodyHandle!=0, if physics body present: calculates new rotation angles (entity.rotation synced from physics, current values), calls b3dSetPhysicsBodyRotation(physicsBodyHandle, newPitch, newYaw, newRoll), physics system owns orientation. If no physics body: updates entity.rotation directly (rotation.x += pitch, rotation.y += yaw, rotation.z += roll), marks worldMatrixDirty=true. Angle accumulation: no clamping/wrapping (angles can exceed 360 degrees, normalized during matrix calculation), accumulated rotation may cause angle drift in some scenarios (use b3dRotateEntity to reset to known angles periodically). Use cases: (1) Spinning objects (coins, power-ups, propellers), (2) Turret tracking (incremental aim adjustment), (3) Vehicle turning (steer left/right), (4) Camera look (mouse delta to pitch/yaw delta), (5) Animated rotation (rotate slowly over time). Common pattern: b3dTurnEntity(entity, 0, 2, 0) rotates 2 degrees around Y-axis per frame (spinning), b3dTurnEntity(camera, mouseDeltaY, mouseDeltaX, 0) for mouse-look camera. Coordinate axes: pitch rotates around X-axis (look up/down), yaw rotates around Y-axis (turn left/right), roll rotates around Z-axis (tilt sideways). Typical usage: call every frame with small deltas for smooth rotation, or call once for discrete rotation steps, combine with b3dMoveEntity for movement + rotation. Performance: O(1) operation (simple addition), physics routing more expensive than direct rotation. Related: b3dRotateEntity sets absolute rotation (replaces current), b3dMoveEntity moves in local space (uses rotation), b3dSetPhysicsBodyRotation for physics-driven rotation, b3dPointEntity orients toward target.