Well, Is it possible to disable x & z rotation in ammo.js? (I want to create a FPS Player and I want to keep it in vertical position)
In bullet there is btRigidBody::setAngularFactor which takes a btVector3 as argument, where x, y and z corresponds to rotation along those axis. Use a 1 to allow motion, and 0 to disallow motion along a certain axis.
If you want to allow rotation only along the Y axis in ammo.js, use:
body.setAngularFactor( 0, 1, 0 );
See http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Code_Snippets
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With