WebGLBook
WebGLBook copied to clipboard
Update sim.js
There were some updates on three.js and SIM.js is not working properly. The main problem is comming form the intersectScene which is now replaced with intersectObjects and some slight modifications are required
More on that here - http://stackoverflow.com/questions/15211171/typeerror-objectobject-object-has-no-method-subself-typeerror-objectobject-o
... answer doesn't seem to be obvious, something like
// var intersects = ray.intersectScene( this.scene ); // old var raycaster = new THREE.Raycaster(camera.position, vector.sub(camera.position).normalize()); var intersects = raycaster.intersectObjects( this.scene );
seems to work