jeromeetienne / threex.domevents

three.js extension which provide dom events inside your 3d scene.
http://jeromeetienne.github.io/threex.domevents/examples/demo.html
MIT License
246 stars 113 forks source link

Support for THREE.CombinedCamera #8

Open fdiazsmith opened 9 years ago

fdiazsmith commented 9 years ago

Setup: THREE r71. and the latest of THREEx.DomEvents. @jeromeetienne When using a THREE.CombinedCamera it does not work at all.

The fix is easy: replace all instances of this:

if ( this._camera instanceof THREE.OrthographicCamera){/*CODE*/}
else if ( this._camera instanceof THREE.PerspectiveCamera ){/*CODE*/}

with this,

if ( this._camera instanceof THREE.OrthographicCamera || this._camera.inOrthographicMode ) {/*CODE*/}
else if ( this._camera instanceof THREE.PerspectiveCamera || this._camera.inPerspectiveMode ) {/*CODE*/}

That did it for me.