Browse Source

Object3D: Removed handy getters/setters for now.
Sadly it made the library 2x slower. The only solution I can think of is by adding public _position, _quaternion and _scale...
Thanks for the ping @arodic!

Mr.doob 11 years ago
parent
commit
69413d77a9
1 changed files with 5 additions and 29 deletions
  1. 5 29
      src/core/Object3D.js

+ 5 - 29
src/core/Object3D.js

@@ -35,44 +35,20 @@ THREE.Object3D = function () {
 	Object.defineProperties( this, {
 	Object.defineProperties( this, {
 		position: {
 		position: {
 			enumerable: true,
 			enumerable: true,
-			get: function () {
-				return position;
-			},
-			set: function ( value ) {
-				console.error( 'THREE.Object3D: .position = new THREE.Vector3() pattern no longer works. Use .position.copy() instead.' );
-				position.copy( value );
-			}
+			value: position
 		},
 		},
 		rotation: {
 		rotation: {
 			enumerable: true,
 			enumerable: true,
-			get: function () {
-				return rotation;
-			},
-			set: function ( value ) {
-				console.error( 'THREE.Object3D: .rotation = new THREE.Euler() pattern no longer works. Use .rotation.copy() instead.' );
-				rotation.copy( value );
-			}
+			value: rotation
 		},
 		},
 		quaternion: {
 		quaternion: {
 			enumerable: true,
 			enumerable: true,
-			get: function () {
-				return quaternion;
-			},
-			set: function ( value ) {
-				console.error( 'THREE.Object3D: .quaternion = new THREE.Quaternion() pattern no longer works. Use .quaternion.copy() instead.' );
-				quaternion.copy( value );
-			}
+			value: quaternion
 		},
 		},
 		scale: {
 		scale: {
 			enumerable: true,
 			enumerable: true,
-			get: function () {
-				return scale;
-			},
-			set: function ( value ) {
-				console.error( 'THREE.Object3D: .scale = new THREE.Vector3() pattern no longer works. Use .scale.copy() instead.' );
-				scale.copy( value );
-			}
-		}
+			value: scale
+		},
 	} );
 	} );
 
 
 	this.renderDepth = null;
 	this.renderDepth = null;