Rotates ALL entities in scene at once using GPU acceleration (O(1) operation).
Takes pitch (X-axis rotation in degrees), yaw (Y-axis rotation in degrees), roll (Z-axis rotation in degrees).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
pitchDouble
yawDouble
rollDouble
Returns
Void
Quick Summary
Rotates ALL entities in scene at once using GPU acceleration (O(1) operation).
Takes pitch (X-axis rotation in degrees), yaw (Y-axis rotation in degrees), roll (Z-axis rotation in degrees).
Returns nothing.
Technical Exegesis...
Rotates ALL entities in scene at once using GPU acceleration (O(1) operation). Takes pitch (X-axis rotation in degrees), yaw (Y-axis rotation in degrees), roll (Z-axis rotation in degrees). Returns nothing. Accumulates rotation in GPU shader, applies to all entities during transform update.
This function rotates entire world.
Rotates ALL entities in scene at once using GPU acceleration (O(1) operation). Takes pitch (X-axis rotation in degrees), yaw (Y-axis rotation in degrees), roll (Z-axis rotation in degrees). Returns nothing. Accumulates rotation in GPU shader, applies to all entities during transform update.
This function rotates entire world. Bulk rotation: rotates all entities simultaneously, O(1) complexity regardless of entity count (100 or 100,000 entities same cost), rotation accumulated in GPU compute shader, applied during hierarchy transform pass. GPU accumulation: stores rotation in g_bulkRotationAccumDeg (XMFLOAT3), sets g_bulkRotationActive = true (enables bulk rotation), GPU shader adds accumulator to each entity's rotation, no per-entity CPU loop required. Physics synchronization: if any physics entities exist (g_hasAnyPhysicsEntities = true), iterates all mesh entities with physics bodies, calls b3dTurnPhysicsBody for each physics entity, ensures physics bodies rotate with visual entities. Use cases: (1) Rotate entire level around player (planetary rotation, spinning space station), (2) Camera-relative world rotation (trackball controls, 3D model viewer), (3) Architectural visualization (spin building to show all sides), (4) Puzzle games (rotate entire puzzle board), (5) Gravity manipulation (tilt world to change gravity direction). Common patterns: planet rotation = b3dTurnAllEntities(0, 0.1, 0) for slow spin, trackball viewer = b3dTurnAllEntities(mouseY, mouseX, 0) for interactive rotation, gravity tilt = b3dTurnAllEntities(tiltAngle, 0, 0) for platformer mechanics, architectural tour = b3dTurnAllEntities(0, autoRotateSpeed, 0) for showcase. Typical usage: call each frame with small increments for smooth rotation, use for world-space effects (not individual entities), combine with camera positioning for viewer applications, rarely used in typical games (more common in tools/visualizers). Performance: O(1) CPU cost (just accumulator update), GPU applies to all entities in single pass, minimal overhead regardless of entity count, physics sync is O(n) but only if physics entities exist (g_hasAnyPhysicsEntities flag). Rotation accumulation: each call adds to accumulator (not absolute), pitch/yaw/roll added to g_bulkRotationAccumDeg.x/y/z, accumulator persists across frames, baked to entity rotations when individual transforms change. Sync back to CPU: when any entity's transform changes individually (b3dRotateEntity, b3dTurnEntity, etc.), SyncBulkRotation() is called, accumulator baked into all entity.rotation fields, accumulator reset to (0,0,0) after syncing, prevents double-rotation on next bulk update. Euler angles: rotation in degrees (Pitch, Yaw, Roll), Pitch = X-axis rotation (up/down), Yaw = Y-axis rotation (left/right), Roll = Z-axis rotation (tilt/barrel roll), rotation order: YXZ (yaw first, then pitch, then roll). Physics handling: if g_hasAnyPhysicsEntities = false, skips physics loop entirely (fast path), if true, iterates all entities and rotates physics bodies, prevents physics objects from desynchronizing with visual entities, maintains collision accuracy. World vs local rotation: this is world-space rotation (rotates entire coordinate system), not local rotation (individual entity orientation), affects all entities uniformly, camera also rotated unless excluded. Entity count independence: 100 entities or 100,000 entities = same CPU cost, GPU compute shader parallelizes transform updates, accumulator applied per-entity in GPU shader, no CPU iteration or per-entity function calls. Accumulator reset: accumulator baked when individual entity transform changes, prevents accumulator from growing unbounded, maintains consistency between CPU entity data and GPU transforms, sync triggered by b3dPositionEntity, b3dRotateEntity, etc. Use with cameras: rotating all entities rotates camera too, workaround = counter-rotate camera after bulk rotation, or exclude camera from bulk rotation (manual handling), typical use case = fixed camera with rotating world. Architectural visualization example: viewer application for 3D models, user drags mouse to rotate model, b3dTurnAllEntities rotates entire scene, camera stays fixed for stable view, interactive exploration without per-entity rotation. Gravity manipulation example: platformer where world tilts, b3dTurnAllEntities rotates level geometry, physics bodies rotate with visuals, player experiences gravity shift, used in games like "And Yet It Moves". Performance characteristics: CPU cost = 3 additions + 2 boolean assignments, GPU cost = per-entity rotation matrix multiplication (parallelized), physics cost = O(n) for n physics entities (skipped if none exist), overall extremely efficient for bulk operations. Rotation direction: positive pitch = rotate up (nose up), positive yaw = rotate right (turn right), positive roll = tilt right (barrel roll right), negative values rotate opposite directions. Related: b3dRotateEntity rotates individual entity (local rotation), b3dTurnEntity turns individual entity (relative rotation), b3dTurnPhysicsBody rotates physics body (physics synchronization), SyncBulkRotation internal function (bakes accumulator to entities).