Interface IPhysicsEngine
Hierarchy
- IPhysicsEngine
Implemented by
Index
Properties
gravitySearch playground for gravity
Gets the gravity vector used by the simulation
Methods
_stepSearch playground for _step
Called by the scene. No need to call it.
Parameters
delta: number
defines the timespan between frames
Returns void
disposeSearch playground for dispose
Release all resources
Returns void
get Physics PluginSearch playground for getPhysicsPlugin
Gets the current plugin used to run the simulation
Returns null | IPhysicsEnginePlugin | IPhysicsEnginePluginV2
current plugin
get Physics Plugin NameSearch playground for getPhysicsPluginName
Gets the name of the current physics plugin
Returns string
the name of the plugin
get Plugin VersionSearch playground for getPluginVersion
Returns number
get Sub Time StepSearch playground for getSubTimeStep
Get the sub time step of the physics engine.
Returns number
the current sub time step
get Time StepSearch playground for getTimeStep
Get the time step of the physics engine.
Returns number
the current time step
raycastSearch playground for raycast
Does a raycast in the physics world
Parameters
Returns PhysicsRaycastResult
PhysicsRaycastResult
set GravitySearch playground for setGravity
Sets the gravity vector used by the simulation
Parameters
gravity: Vector3
defines the gravity vector to use
Returns void
set Sub Time StepSearch playground for setSubTimeStep
Set the sub time step of the physics engine. Default is 0 meaning there is no sub steps To increase physics resolution precision, set a small value (like 1 ms)
Parameters
subTimeStep: number
defines the new sub timestep used for physics resolution.
Returns void
set Time StepSearch playground for setTimeStep
Set the time step of the physics engine. Default is 1/60. To slow it down, enter 1/600 for example. To speed it up, 1/30
Parameters
newTimeStep: number
the new timestep to apply to this world.
Returns void
Interface used to define a physics engine
https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine