CLASSES
TagsA - Z

CannonJSPlugin

Plugins

Description

class CannonJSPlugin

Constructor

new CannonJSPlugin(_useDeltaForWorldStep, iterations)

Parameters

Name Type Description
optional _useDeltaForWorldStep boolean
optional iterations number default : 10. The bigger are the iterations the more precise will be the equations but while calculating more the performance impacted

Members

world : any

name : string

Methods

setGravity(gravity) void

Applies the given gravity into the world

Parameters

Name Type Description
gravity Vector3 The given gravity

setTimeStep(timeStep) void

Parameters

Name Type Description
timeStep number

executeStep(delta, impostors) void

Parameters

Name Type Description
delta number The fixed time step size to use.
impostors Array<PhysicsImpostor>

applyImpulse(impostor, force, contactPoint) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use
force Vector3 The force to apply
contactPoint Vector3 The contact point on the given mesh

applyForce(impostor, force, contactPoint) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use
force Vector3 The force to apply
contactPoint Vector3 The contact point on the given mesh

generatePhysicsBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use

removePhysicsBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use

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 The impostor to use

setPhysicsBodyTransformation(impostor, newPosition, newRotation) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use
newPosition Vector3
newRotation Quaternion

isSupported() boolean

setLinearVelocity(impostor, velocity) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use
velocity Vector3

setAngularVelocity(impostor, velocity) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use
velocity Vector3

getLinearVelocity(impostor) Vector3

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use

getAngularVelocity(impostor) Vector3

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use

setBodyMass(impostor, mass) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use
mass number

sleepBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use

wakeUpBody(impostor) void

Parameters

Name Type Description
impostor PhysicsImpostor The impostor to use

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

dispose() void

Disposes the CannonJSPlugin