jeromeetienne/threex — pull request #27 by rharriso (2012-07-18 18:39:58+00:00)
Title: Improvements for the mouse events

I stripped the tests out of my commit, should make reading through simpler. Only the internals of this class have been changed, the binding and unbind of objects works the same.

My changes are threefold

1. added use capture to parameters in Object3d.prototype.addEventListener. This is a parameter in theex.domevent.bind but was missing from the Object3d call.

2. Allowed dom element to be changed. Also, the height and position of the dom element are calculated from the dom element instead of using the whole window.

3. Improve bound element tracking. Previously Object3d would be bound separately for each event. This meant that each Object3d is tested once per bound event. With this update the bound Object3ds are only tested for ray trace once.