Sets physics body angular velocity in deg/sec (vx/vy/vz spin rates around axes).
Takes bodyHandle (physics body from b3dCreatePhysicsBody), vx/vy/vz (angular velocity in degrees per second around X/Y/Z axes).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
bodyHandleInt
vxDouble
vyDouble
vzDouble
Returns
Void
Quick Summary
Sets physics body angular velocity in deg/sec (vx/vy/vz spin rates around axes).
Takes bodyHandle (physics body from b3dCreatePhysicsBody), vx/vy/vz (angular velocity in degrees per second around X/Y/Z axes).
Returns nothing.
Technical Exegesis...
Sets physics body angular velocity in deg/sec (vx/vy/vz spin rates around axes). Takes bodyHandle (physics body from b3dCreatePhysicsBody), vx/vy/vz (angular velocity in degrees per second around X/Y/Z axes). Returns nothing. Converts degrees to radians, sets Jolt angular velocity, affects body rotation over time. Use for spinning objects, rotational control, or stopping spin.
This function sets rotational velocity.
Sets physics body angular velocity in deg/sec (vx/vy/vz spin rates around axes). Takes bodyHandle (physics body from b3dCreatePhysicsBody), vx/vy/vz (angular velocity in degrees per second around X/Y/Z axes). Returns nothing. Converts degrees to radians, sets Jolt angular velocity, affects body rotation over time. Use for spinning objects, rotational control, or stopping spin.
This function sets rotational velocity. Angular velocity components: vx (rotation speed around X-axis in deg/sec, positive = pitch down, negative = pitch up), vy (rotation speed around Y-axis in deg/sec, positive = yaw left, negative = yaw right), vz (rotation speed around Z-axis in deg/sec, positive = roll left, negative = roll right). Degrees to radians conversion: BambooBasic uses degrees for user-friendly input (360 deg = full rotation), Jolt uses radians internally (2*PI rad = full rotation), conversion factor 0.0174532925 (PI/180) applied to each component. Velocity behavior: angular velocity affects orientation each physics step (rotation += angularVelocity * deltaTime), angular damping reduces spin over time (if configured via b3dSetPhysicsBodyDamping), collisions change angular velocity (friction and impact torque applied), no automatic clamping (can spin arbitrarily fast). Use cases: (1) Spinning objects (set constant spin for wheels, fans, projectiles), (2) Torque simulation (set angular velocity for rotational forces), (3) Stop spinning (set 0,0,0 to halt rotation), (4) Kinematic rotation (override physics with scripted spin), (5) Gyroscopic effects (combine linear and angular velocity). Common patterns: spin around Y b3dSetPhysicsBodyAngularVelocity(body, 0, 180, 0), stop spinning b3dSetPhysicsBodyAngularVelocity(body, 0, 0, 0), tumble randomly b3dSetPhysicsBodyAngularVelocity(body, Rnd()*360-180, Rnd()*360-180, Rnd()*360-180). Typical usage: set after applying torque impulse for controlled spin, combine with b3dSetPhysicsBodyRotation to set both orientation and spin rate, use for kinematic rotation control (spinning platforms, rotating doors). Coordinate system: vx/vy/vz in BambooBasic Y-up world coordinates (rotation around world axes), converted to Jolt Vec3 radians (Jolt also uses Y-up), angular velocity in world space (not local to body rotation unless body aligned with world). Angular velocity vs torque: b3dSetPhysicsBodyAngularVelocity sets velocity directly (replaces current spin, immediate effect, ignores inertia), b3dApplyPhysicsTorque adds rotational impulse (incremental change, respects inertia tensor, mass distribution affects result), direct set useful for kinematic control (scripted rotation), torque useful for physics-driven rotation (impacts, motors). Inertia tensor: body mass distribution affects resistance to angular acceleration (sphere rotates easily, long rod resists rotation around short axis), b3dSetPhysicsBodyAngularVelocity bypasses inertia (same angular velocity regardless of shape/mass), torque respects inertia (harder to spin objects with high moment of inertia). Collision response: angular velocity changes during collisions (friction applies counter-torque, impacts add spin from off-center forces), manually set angular velocity overrides collision response (may cause unrealistic behavior if set carelessly), use after collision to modify post-collision spin. Gyroscopic precession: high angular velocity creates gyroscopic stability (spinning objects resist orientation changes), Jolt simulates gyroscopic effects (spinning top stays upright), very high spin rates may cause numerical instability (clamp if needed). Performance: O(1) operation (Vec3 conversion and set via Jolt BodyInterface), applied immediately (affects next physics step), no activation needed (angular velocity change doesn't require waking body). Static body behavior: static bodies (mass=0) ignore angular velocity (immovable and non-rotating by definition), setting angular velocity on static body has no effect (orientation unchanged), convert to dynamic (mass>0) if rotation needed. Angular damping: if b3dSetPhysicsBodyDamping called with angularDamping>0 spin decays over time (velocity *= 1-damping each frame), damping 0.0 = no decay (spin forever in space), damping 1.0 = immediate stop (heavy air resistance). Validation: silently returns if g_physicsSystem not initialized, silently returns if bodyHandle not found in g_bodyHandleToBodyID, no clamping (extreme spin rates allowed but may cause instability). Degrees per second: 360 deg/sec = 1 full rotation per second (1 Hz), 180 deg/sec = half rotation per second (slow tumble), 1800 deg/sec = 5 rotations per second (fast spin). Related: b3dSetPhysicsBodyRotation sets orientation (angular velocity causes rotation to change over time), b3dApplyPhysicsTorque applies rotational impulse (alternative to direct angular velocity set), b3dSetPhysicsBodyVelocity sets linear velocity (combine for spinning projectile), b3dSetPhysicsBodyDamping sets angular damping (controls spin decay rate).