GoblinPhysics
GoblinPhysics copied to clipboard
Use THREE.Euler.DefaultOrder = "YXZ" in exampleUtils.js
The camera in the various demos (for instance, http://www.goblinphysics.com/examples/constraint-revolute.html) rotates in weird ways because the default "default Euler order" is set to "XYZ" in Three.js. By adding:
THREE.Euler.DefaultOrder = "YXZ";
at the start of exampleUtils.js
, it should fix the issue and your camera will stay parallel to the ground.
Thanks for the tip! I think some of the demos lose effect if they can't rotate freely along all axes. However, it makes sense for others such as the one you linked. I'll give it some thought.
Three now has an OrbitControls
class which keeps the camera's Y
axis stable.