Experience-Monks / orbit-controls

generic controls for orbiting a target in 3D
http://jam3.github.io/orbit-controls/
MIT License
110 stars 17 forks source link

Fix EPSILON #11

Closed 525c1e21-bd67-4735-ac99-b4b0e5262290 closed 8 years ago

525c1e21-bd67-4735-ac99-b4b0e5262290 commented 8 years ago

The title of #10 should have read "EPSILON way too small".

Suggesting Number.EPSILON was a mistake as it relates to doubles and is far too small.

e335c74b72609f2cc948ce08a067dda0700fdef1 broke pitching a perspective-camera all the way "up" or "down" using an orbit-controls.

This is due to routines like gl-mat4/invert failing to behave when backed by Float32Arrays which I demonstrate in #5

See https://en.wikipedia.org/wiki/Machine_epsilon for formulaic explanations.

For the record: gl-matrix uses 0.000001 which you'll agree is more than close enough.

I apologise for any confusion as well as my mistaken suggestion.

This change should also alleviate many instances of #5 ^w^

mattdesl commented 8 years ago

Thanks @pyrotechnick for digging! Would you like to be a contributor to this module as well?

525c1e21-bd67-4735-ac99-b4b0e5262290 commented 8 years ago

If you flip my commit bit I can fix my own mistakes!

mattdesl commented 8 years ago

This is merged + patched in v1.0.4

mattdesl commented 8 years ago

You're now a contributor. :smile: Guidelines: http://openopensource.org/