Re-enables previously disabled physics body simulation.
Takes entityHandle (entity with disabled physics body).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityHandleInt
Returns
Void
Quick Summary
Re-enables previously disabled physics body simulation.
Takes entityHandle (entity with disabled physics body).
Returns nothing.
Technical Exegesis...
Re-enables previously disabled physics body simulation. Takes entityHandle (entity handle with physics body disabled via b3dDisablePhysicsBody). Returns nothing. Reactivates Jolt physics body, adding it back to active simulation with all properties preserved.
Re-enables previously disabled physics body simulation. Takes entityHandle (entity handle with physics body disabled via b3dDisablePhysicsBody). Returns nothing. Reactivates Jolt physics body, adding it back to active simulation with all properties preserved.
Physics enable: body added back to active simulation (collision detection resumes, gravity/forces applied, position/rotation updated by physics), body properties preserved from disable (mass, friction, restitution, shape, velocity all retained, no reconfiguration needed), fast activation (no allocation overhead, just reactivation flag). Use to resume physics after temporary disable.
Use cases: (1) Resume after pause (re-enable all physics bodies when gameplay unpauses), (2) End cutscene (re-enable physics after scripted animation), (3) LOD (re-enable physics when object returns to close range), (4) Drop object (re-enable physics when player releases picked-up object). Common patterns: unpause (b3dEnablePhysicsBody for all entities), end cutscene (enable player physics after manual animation), LOD (if distance < 90 then enable, if distance > 100 then disable).
Enable vs create: b3dEnablePhysicsBody reactivates existing body (fast, properties preserved, used after b3dDisablePhysicsBody), b3dCreatePhysicsBody creates new body (slower, requires property configuration, used initially or after b3dDestroyPhysicsBody). Velocity preservation: disabled body retains velocity (when re-enabled, body continues motion from where it left off, useful for pause/unpause, may want to zero velocity for some use cases).
Performance: fast operation (simple activation flag, no allocation), body immediately participates in next physics step (collision detection and simulation resume). Validation: silently returns if entityHandle invalid, silently returns if entity has no physics body, safe to call on already-enabled body (no-op).
Related: b3dDisablePhysicsBody disables physics body (inverse operation), b3dCreatePhysicsBody creates initial physics body, b3dDestroyPhysicsBody destroys body permanently (requires b3dCreatePhysicsBody to recreate, not b3dEnablePhysicsBody).
Example
Example.bam
; Disable and re-enable physics for cutscene; Disable
b3dDisablePhysicsBody(player)
; Manually control player during cutscene
b3dPositionEntity(player, x, y, z)
b3dRotateEntity(player, pitch, yaw, roll)
; Re-enable after cutscene
b3dEnablePhysicsBody(player)
; LOD system with hysteresisFor i = 0To lastEntity
entity = entityList(i)
distance = EntityDistance(player, entity)
If distance > 100Then
b3dDisablePhysicsBody(entity) ; Disable far away
ElseIf distance < 90Then
b3dEnablePhysicsBody(entity) ; Re-enable when closer
EndIf ; 90-100 range keeps current state (hysteresis)
Next; Picked-up object physicsIf pickingUp Then
b3dDisablePhysicsBody(object)
; Parent to player hand
ElseIf dropping Then
b3dEnablePhysicsBody(object)
; Set velocity for throw
b3dSetPhysicsBodyVelocity(object, vx, vy, vz)
EndIf