added move event listener to FirstPersonControls

This commit is contained in:
mschuetz 2014-06-17 16:25:16 +02:00
parent 9de75179b2
commit 0a8ed33f74
2 changed files with 9 additions and 1 deletions

View File

@ -171,6 +171,14 @@ THREE.FirstPersonControls = function ( object, domElement ) {
}
}
if(!pan.equals(new THREE.Vector3(0,0,0))){
var event = {
type: 'move',
translation: pan.clone()
};
this.dispatchEvent(event);
}
position.add(pan);
this.object.updateMatrix();

View File

@ -21,7 +21,7 @@ THREE.PerspectiveCamera.prototype.zoomTo = function(node){
];
var frustum = new THREE.Frustum();
frustum.setFromMatrix(new THREE.Matrix4().multiply(this.projectionMatrix, this.matrixWorldInverse));
frustum.setFromMatrix(new THREE.Matrix4().multiplyMatrices(this.projectionMatrix, this.matrixWorldInverse));
var max = Number.MIN_VALUE;
for(var i = 0; i < ps.length; i++){