O'Reilly logo

WebGL Game Development by Sumeet Arora

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing forces, impulse, and collision detection

JigLibJS offers functions to add force and apply impulse to a rigid body. Let's walk through the list of available functions and how they work:

addBodyForce=function(f, p) f: [x,y,z] magnitude of force along three axes. p:[x,y,z] position of force addWorldForce=function(f, p) f: [x,y,z] magnitude of force along three axes. p:[x,y,z] position of force addWorldTorque=function(t) t: [x,y,z] magnitude of torque along three axes. addBodyTorque=function(t) t: [x,y,z] magnitude of torque along three axes. applyWorldImpulse=function(impulse, pos) impulse: [x,y,z] magnitude of impulse(mass*velocity) along three axes. pos:[x,y,z] position of force applyBodyWorldImpulse=function(impulse, delta) impulse: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required