class PhysicsBridge(val spatial: SpatialInterface)
PhysicsBridge
(
spatial
)
|
spatial
: SpatialInterface
[Get] |
Signature
val spatial: SpatialInterface |
deletePhysics
(
entity
)
|
Removes physics components from the specified entity.
This method should be called when an entity with physics components is being deleted or when physics simulation is no longer needed for that entity.
Signature
fun deletePhysics(entity: Entity) Parameters |
enablePhysicsDebugLines
(
enabled
)
|
Toggles debug lines for visualization of the physics simulation. The color of the lines correspond to the state of the physics objects.
This is useful for debugging physics interactions and understanding how physics bodies are behaving in the scene.
Signature
fun enablePhysicsDebugLines(enabled: Boolean) Parameters
enabled:
Boolean
|
potentiallyActivatePhysicsBodies
()
|
Potentially activates physics bodies that were deactivated due to deleted objects.
When a physics object is deleted, nearby physics bodies may need to be re-enabled to properly respond to the change in the physics world.
Signature
fun potentiallyActivatePhysicsBodies() |
setGravity
(
x
, y
, z
)
|
Sets the gravity vector for the physics simulation.
This method allows customizing the direction and strength of gravity in the physics world, which affects how objects fall and interact.
Signature
fun setGravity(x: Float, y: Float, z: Float) Parameters
x:
Float
y:
Float
z:
Float
|
tickPhysics
()
|
Advances the physics simulation for a single frame.
This method performs collision detection, constraint solving, and integration of physics bodies, updating their positions and orientations.
Signature
fun tickPhysics() |