PhysicsObject Class
Wrapper for cannon.js physics objects.
The editor includes tools to create cannon shapes from three.js geometry objects.
Documentation for cannon.js physics available here http:// schteppe.github.io/cannon.js/docs/
Methods
addShape
(
-
shape
Add shape to physics object body.
Parameters:
-
shape
Shape
initialize
()
Intialize physics object and add it to the scene physics world.
update
()
Update object position and rotation based on cannon.js body.
Attributes
body
Body
Physics body contains the following attributes:
- position Vec3
- velocity Vec3
- torque Vec3
- angularVelocity Vec3
- quaternion Quaternion
- mass Number
- material Material
- type Number
- linearDamping Number
- angularDamping Number
- allowSleep Boolean
- sleepSpeedLimit Number
- sleepTimeLimit Number
- collisionFilterGroup Number
- collisionFilterMask Number
- fixedRotation Boolean
- shape Array
LOCAL
Number
static
The position of the object is copied directly from the body.
Ignores the world tranforms inherited from parent objects.
Faster but the physics object should not carry any world transformations.