jeromeetienne/threex — pull request #24 by rharriso (2012-06-20 15:52:26+00:00)
Title: Threex.Domevents

Hello,

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

1. 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.
2. Changed the way that the ray origin was being determined so that it was using the domElement size and position, instead of the window.
3. 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.