Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PhysicsEngineV2

Implements

Index

Constructors

  • Creates a new Physics Engine

    Parameters

    • gravity: Nullable<Vector3>

      defines the gravity vector used by the simulation

    • Optional _physicsPlugin: IPhysicsEnginePluginV2

      defines the plugin to use (CannonJS by default)

    Returns PhysicsEngineV2

Properties

gravity: Vector3

Gets the gravity vector used by the simulation

Methods

  • _step(delta: number): void
  • Called by the scene. No need to call it.

    Parameters

    • delta: number

      defines the timespan between frames

    Returns void

  • Add a body as an active component of this engine

    Parameters

    Returns void

  • dispose(): void
  • Release all resources

    Returns void

  • Returns an array of bodies added to this engine

    Returns PhysicsBody[]

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

    Returns IPhysicsEnginePluginV2

    current plugin

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

    Returns string

    the name of the plugin

  • getPluginVersion(): number
  • getSubTimeStep(): number
  • Get the sub time step of the physics engine.

    Returns number

    the current sub time step

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

    Returns number

    the current time step

  • Does a raycast in the physics world

    Parameters

    Returns void

  • Removes a particular body from this engine

    Parameters

    Returns void

  • Sets the gravity vector used by the simulation

    Parameters

    • gravity: Vector3

      defines the gravity vector to use

    Returns void

  • setSubTimeStep(subTimeStep?: number): void
  • 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

    • Optional subTimeStep: number

      defines the new sub timestep used for physics resolution.

    Returns void

  • 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

  • DefaultPluginFactory(): IPhysicsEnginePluginV2
  • Factory used to create the default physics plugin.

    Returns IPhysicsEnginePluginV2

    The default physics plugin

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme