Parcourir la source

Object3D: Reverted this.position to non-configurable position.
Sadly there is a lot of examples abusing the object.position = target.position pattern.

Mr.doob il y a 11 ans
Parent
commit
35e18100c4
2 fichiers modifiés avec 5 ajouts et 9 suppressions
  1. 0 2
      examples/webgl_loader_collada_keyframe.html
  2. 5 7
      src/core/Object3D.js

+ 0 - 2
examples/webgl_loader_collada_keyframe.html

@@ -129,8 +129,6 @@
 
 				pointLight = new THREE.PointLight( 0xffffff, 1.75 );
 				pointLight.position = camera.position;
-				pointLight.rotation = camera.rotation;
-				pointLight.scale = camera.scale;
 
 				scene.add( pointLight );
 

+ 5 - 7
src/core/Object3D.js

@@ -17,27 +17,25 @@ THREE.Object3D = function () {
 
 	this.up = new THREE.Vector3( 0, 1, 0 );
 
+	this.position = new THREE.Vector3();
+
 	var scope = this;
 
 	Object.defineProperties( this, {
-		position: { 
-			enumerable: true, 
-			value: new THREE.Vector3()
-		},
 		rotation: {
-			enumerable: true,	
+			enumerable: true,
 			value: new THREE.Euler().onChange( function () {
 				scope.quaternion.setFromEuler( scope.rotation, false );
 			} )
 		},
 		quaternion: {
-			enumerable: true,	
+			enumerable: true,
 			value: new THREE.Quaternion().onChange( function () {
 				scope.rotation.setFromQuaternion( scope.quaternion, undefined, false );
 			} )
 		},
 		scale: {
-			enumerable: true,	
+			enumerable: true,
 			value: new THREE.Vector3( 1, 1, 1 )
 		}
 	} );