2
0
Эх сурвалжийг харах

removing references to `camera` global

replacing with `this`

pyrotechnick 14 жил өмнө
parent
commit
5fc7b02d25
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      src/cameras/Camera.js

+ 2 - 2
src/cameras/Camera.js

@@ -15,7 +15,7 @@ THREE.Camera = function ( fov, aspect, near, far ) {
 
 	this.translateX = function ( amount ) {
 
-		var vector = camera.target.position.clone().subSelf( camera.position ).normalize().multiplyScalar( amount );
+		var vector = this.target.position.clone().subSelf( this.position ).normalize().multiplyScalar( amount );
 		vector.cross( vector.clone(), this.up );
 
 		this.position.addSelf( vector );
@@ -31,7 +31,7 @@ THREE.Camera = function ( fov, aspect, near, far ) {
 
 	this.translateZ = function ( amount ) {
 
-		var vector = camera.target.position.clone().subSelf( camera.position ).normalize().multiplyScalar( amount );
+		var vector = this.target.position.clone().subSelf( this.position ).normalize().multiplyScalar( amount );
 
 		this.position.subSelf( vector );
 		this.target.position.subSelf( vector );