CLASSES
TagsA - Z

PhysicsEngine

Engine

Description

class PhysicsEngine

Constructor

new PhysicsEngine(gravity, _physicsPlugin)

Parameters

Name Type Description
optional gravity Vector3
optional _physicsPlugin IPhysicsEnginePlugin

Members

gravity : Vector3

The gravity value applied by the engine

static Epsilon : number

Returns epsilon value : 0.001, used for approximations

Methods

setGravity(gravity) → void

Parameters

Name Type Description
gravity Vector3

setTimeStep(newTimeStep) → 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

Name Type Description
optional newTimeStep number

dispose() → void

Calls the dispose method of the loaded engine

getPhysicsPluginName() → string

addImpostor(impostor) → void

Adding a new impostor for the impostor tracking.

This will be done by the impostor itself.

Parameters

Name Type Description
impostor PhysicsImpostor

removeImpostor(impostor) → void

Remove an impostor from the engine.

This impostor and its mesh will not longer be updated by the physics engine.

Parameters

Name Type Description
impostor PhysicsImpostor

addJoint(mainImpostor, connectedImpostor, joint) → void

Add a joint to the physics engine

Parameters

Name Type Description
mainImpostor PhysicsImpostor
connectedImpostor PhysicsImpostor
joint PhysicsJoint

removeJoint(mainImpostor, connectedImpostor, joint) → void

Parameters

Name Type Description
mainImpostor PhysicsImpostor
connectedImpostor PhysicsImpostor
joint PhysicsJoint

getPhysicsPlugin() → IPhysicsEnginePlugin

getImpostorForPhysicsObject(object) → PhysicsImpostor

Parameters

Name Type Description
object IPhysicsEnabledObject

getImpostorWithPhysicsBody(body) → PhysicsImpostor

Parameters

Name Type Description
body any