CLASSES
TagsA - Z

CannonJSPlugin

Plugins

Description

class CannonJSPlugin

Constructor

new CannonJSPlugin(_useDeltaForWorldStep, iterations)

Parameters

Name Type Description
optional _useDeltaForWorldStep boolean
optional iterations number

Members

world : any

name : string

BJSCANNON : any

Methods

setGravity(gravity) void

Parameters

Name Type Description
gravity Vector3

setTimeStep(timeStep) void

Parameters

Name Type Description
timeStep number

getTimeStep() number

executeStep(delta, impostors) void

Parameters

Name Type Description
delta number
impostors Array<PhysicsImpostor>

applyImpulse(impostor, force, contactPoint) void

Parameters

Name Type Description
impostor PhysicsImpostor
force Vector3
contactPoint Vector3

applyForce(impostor, force, contactPoint) void

Parameters

Name Type Description
impostor PhysicsImpostor
force Vector3
contactPoint Vector3

generatePhysicsBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor

removePhysicsBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor

generateJoint(impostorJoint) void

Parameters

Name Type Description
impostorJoint PhysicsImpostorJoint

removeJoint(impostorJoint) void

Parameters

Name Type Description
impostorJoint PhysicsImpostorJoint

setTransformationFromPhysicsBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor

setPhysicsBodyTransformation(impostor, newPosition, newRotation) void

Parameters

Name Type Description
impostor PhysicsImpostor
newPosition Vector3
newRotation Quaternion

isSupported() boolean

setLinearVelocity(impostor, velocity) void

Parameters

Name Type Description
impostor PhysicsImpostor
velocity Vector3

setAngularVelocity(impostor, velocity) void

Parameters

Name Type Description
impostor PhysicsImpostor
velocity Vector3

getLinearVelocity(impostor) Vector3

Parameters

Name Type Description
impostor PhysicsImpostor

getAngularVelocity(impostor) Vector3

Parameters

Name Type Description
impostor PhysicsImpostor

setBodyMass(impostor, mass) void

Parameters

Name Type Description
impostor PhysicsImpostor
mass number

getBodyMass(impostor) number

Parameters

Name Type Description
impostor PhysicsImpostor

getBodyFriction(impostor) number

Parameters

Name Type Description
impostor PhysicsImpostor

setBodyFriction(impostor, friction) void

Parameters

Name Type Description
impostor PhysicsImpostor
friction number

getBodyRestitution(impostor) number

Parameters

Name Type Description
impostor PhysicsImpostor

setBodyRestitution(impostor, restitution) void

Parameters

Name Type Description
impostor PhysicsImpostor
restitution number

sleepBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor

wakeUpBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor

updateDistanceJoint(joint, maxDistance, minDistance) void

Parameters

Name Type Description
joint PhysicsJoint
maxDistance number
optional minDistance number

setMotor(joint, speed, maxForce, motorIndex) void

Parameters

Name Type Description
joint IMotorEnabledJoint
optional speed number
optional maxForce number

setLimit(joint, upperLimit, lowerLimit) void

Parameters

Name Type Description
joint IMotorEnabledJoint
upperLimit number
optional lowerLimit number

syncMeshWithImpostor(mesh, impostor) void

Parameters

Name Type Description
mesh AbstractMesh
impostor PhysicsImpostor

getRadius(impostor) number

Parameters

Name Type Description
impostor PhysicsImpostor

getBoxSizeToRef(impostor, result) void

Parameters

Name Type Description
impostor PhysicsImpostor
result Vector3

dispose() void