jeromeetienne/threex — pull request #26 by rharriso (2012-07-18 16:18:02+00:00)
Title: Improvements and tests for the mouse events

Hello,

I've been working with threeX.domevents recently. And I made a couple of what I think are improvements:

# Added a few methods that allow the domElement to be changed. Previously the document was used, this could lead to problems if the canvas element was offset from the top left, or not the full size of the window.
Changed the way that the ray origin was being determined so that it was using the domElement size and position, instead of the window.
# Limited the number of times an object3d is placed in the _boundObjs array to one. Previously, every time an Object3d had an event listener added, another reference would be pushed to the _boundObjs list. This meant that if an object3d had n events bound to it, then it would be tested n time on ray trace.
The changes should be backwards compatible.