소스 검색

removing references to `camera` global

replacing with `this`

pyrotechnick 14 년 전
부모
커밋
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 );