jeromeetienne / threex.domevents

three.js extension which provide dom events inside your 3d scene.

Home Page:http://jeromeetienne.github.io/threex.domevents/examples/demo.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for THREE.CombinedCamera

fdiazsmith opened this issue · comments

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.