IPhysicsEngine

Interface used to define a physics engine

see

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

Hierarchy

  • IPhysicsEngine

Implemented by

Index

Properties

gravity

gravity: Vector3

Gets the gravity vector used by the simulation

Methods

addImpostor

  • Adding a new impostor for the impostor tracking. This will be done by the impostor itself.

    Parameters

    Returns void

addJoint

  • 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

  • dispose(): void
  • Release all resources

    Returns void

getImpostorForPhysicsObject

getImpostorWithPhysicsBody

  • Gets the impostor for a physics body object

    Parameters

    • body: any

      defines physics body used by the impostor

    Returns Nullable<PhysicsImpostor>

    the PhysicsImpostor or null if not found

getImpostors

  • Gets the list of physic impostors

    Returns Array<PhysicsImpostor>

    an array of PhysicsImpostor

getPhysicsPlugin

  • getPhysicsPlugin(): IPhysicsEnginePlugin
  • Gets the current plugin used to run the simulation

    Returns IPhysicsEnginePlugin

    current plugin

getPhysicsPluginName

  • getPhysicsPluginName(): string
  • Gets the name of the current physics plugin

    Returns string

    the name of the plugin

getTimeStep

  • getTimeStep(): number
  • Get the time step of the physics engine.

    Returns number

    the current time step

removeImpostor

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

    Parameters

    Returns void

removeJoint

  • Removes a joint from the simulation

    Parameters

    • mainImpostor: PhysicsImpostor

      defines the impostor used with the joint

    • connectedImpostor: PhysicsImpostor

      defines the other impostor connected to the main one by the joint

    • joint: PhysicsJoint

      defines the joint to remove

    Returns void

setGravity

  • setGravity(gravity: Vector3): void
  • Sets the gravity vector used by the simulation

    Parameters

    • gravity: Vector3

      defines the gravity vector to use

    Returns void

setTimeStep

  • 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

    • newTimeStep: number

      the new timestep to apply to this world.

    Returns void

Generated using TypeDoc