PhysicsEngine

Class used to control physics engine

see

http://doc.babylonjs.com/how_to/using_the_physics_engine

Hierarchy

  • PhysicsEngine

Implements

Index

Constructors

constructor

Find examples in Playground
  • Creates a new Physics Engine

    Parameters

    • gravity: Nullable<Vector3>

      defines the gravity vector used by the simulation

    • Optional _physicsPlugin: IPhysicsEnginePlugin

      defines the plugin to use (CannonJS by default)

    Returns PhysicsEngine

Properties

gravity

Find examples in Playground
gravity: Vector3

Gets the gravity vector used by the simulation

Static Epsilon

Find examples in Playground
Epsilon: number

Global value used to control the smallest number supported by the simulation

Methods

addImpostor

Find examples in Playground
  • Adding a new impostor for the impostor tracking. This will be done by the impostor itself.

    Parameters

    Returns void

addJoint

Find examples in Playground
  • Add a joint to the physics engine

    Parameters

    • mainImpostor: PhysicsImpostor

      defines the main impostor to which the joint is added.

    • connectedImpostor: PhysicsImpostor

      defines the impostor that is connected to the main impostor using this joint

    • joint: PhysicsJoint

      defines the joint that will connect both impostors.

    Returns void

dispose

Find examples in Playground
  • dispose(): void

getImpostorForPhysicsObject

Find examples in Playground

getImpostorWithPhysicsBody

Find examples in Playground

getImpostors

Find examples in Playground

getPhysicsPlugin

Find examples in Playground
  • getPhysicsPlugin(): IPhysicsEnginePlugin

getPhysicsPluginName

Find examples in Playground
  • getPhysicsPluginName(): string

getTimeStep

Find examples in Playground
  • getTimeStep(): number

removeImpostor

Find examples in Playground
  • Remove an impostor from the engine. This impostor and its mesh will not longer be updated by the physics engine.

    Parameters

    Returns void

removeJoint

Find examples in Playground

setGravity

Find examples in Playground
  • setGravity(gravity: Vector3): void
  • Sets the gravity vector used by the simulation

    Parameters

    • gravity: Vector3

      defines the gravity vector to use

    Returns void

setTimeStep

Find examples in Playground
  • setTimeStep(newTimeStep?: number): 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

    Parameters

    • Optional newTimeStep: number

      defines the new timestep to apply to this world.

    Returns void

Generated using TypeDoc