b3dDisablePhysicsBody

Temporarily disables physics body simulation without destroying it. Takes entityHandle (entity with physics body from b3dCreatePhysicsBody). Returns nothing.

3D Graphics

Parameters & Returns

Parameters

entityHandle Int

Returns

Void

Quick Summary

Temporarily disables physics body simulation without destroying it. Takes entityHandle (entity with physics body from b3dCreatePhysicsBody). Returns nothing.

Technical Exegesis...

Temporarily disables physics body simulation without destroying it. Takes entityHandle (entity handle with physics body from b3dCreatePhysicsBody). Returns nothing. Deactivates Jolt physics body, removing it from active simulation while preserving body data for later re-enable.

Example

Example.bam
; Disable physics during cutscene
b3dDisablePhysicsBody(player)
; Manually animate player
; ...
; Re-enable physics after cutscene
b3dEnablePhysicsBody(player)

; LOD system - disable distant physics
For i = 0 To lastEntity
    entity = entityList(i)
    distance = EntityDistance(player, entity)
    If distance > 100 Then
        b3dDisablePhysicsBody(entity)
    ElseIf distance < 90 Then
        b3dEnablePhysicsBody(entity)
    EndIf
Next

; Pause all physics
Global paused = 0
If BBR_GetKey(KEY_P) Then
    paused = 1 - paused
    For i = 0 To lastEntity
        If paused Then
            b3dDisablePhysicsBody(entityList(i))
        Else
            b3dEnablePhysicsBody(entityList(i))
        EndIf
    Next
EndIf