API

Class PhysicsEngineV2

Class used to control physics engine

Implements

  • IPhysicsEngine
Index
gravity: Vector3

Gets the gravity vector used by the simulation

  • 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 = 0

      defines the new sub timestep used for physics resolution.

    Returns void

  • 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 Unit is seconds.

    Parameters

    • newTimeStep: number = ...

      defines the new timestep to apply to this world.

    Returns void

  • Set the maximum allowed linear and angular velocities

    Parameters

    • maxLinearVelocity: number

      maximum allowed linear velocity

    • maxAngularVelocity: number

      maximum allowed angular velocity

    Returns void