|
@@ -370,31 +370,10 @@ THREE.Object3D.prototype = {
|
|
|
|
|
|
},
|
|
|
|
|
|
- raycast: function () {},
|
|
|
-
|
|
|
- traverse: function ( callback ) {
|
|
|
-
|
|
|
- callback( this );
|
|
|
-
|
|
|
- for ( var i = 0, l = this.children.length; i < l; i ++ ) {
|
|
|
-
|
|
|
- this.children[ i ].traverse( callback );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- traverseVisible: function ( callback ) {
|
|
|
-
|
|
|
- if ( this.visible === false ) return;
|
|
|
-
|
|
|
- callback( this );
|
|
|
-
|
|
|
- for ( var i = 0, l = this.children.length; i < l; i ++ ) {
|
|
|
-
|
|
|
- this.children[ i ].traverseVisible( callback );
|
|
|
+ getChildByName: function ( name, recursive ) {
|
|
|
|
|
|
- }
|
|
|
+ console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
|
|
|
+ return this.getObjectByName( name, recursive );
|
|
|
|
|
|
},
|
|
|
|
|
@@ -440,54 +419,7 @@ THREE.Object3D.prototype = {
|
|
|
|
|
|
},
|
|
|
|
|
|
- getChildByName: function ( name, recursive ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
|
|
|
- return this.getObjectByName( name, recursive );
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- updateMatrix: function () {
|
|
|
-
|
|
|
- this.matrix.compose( this.position, this.quaternion, this.scale );
|
|
|
-
|
|
|
- this.matrixWorldNeedsUpdate = true;
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- updateMatrixWorld: function ( force ) {
|
|
|
-
|
|
|
- if ( this.matrixAutoUpdate === true ) this.updateMatrix();
|
|
|
-
|
|
|
- if ( this.matrixWorldNeedsUpdate === true || force === true ) {
|
|
|
-
|
|
|
- if ( this.parent === undefined ) {
|
|
|
-
|
|
|
- this.matrixWorld.copy( this.matrix );
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- this.matrixWorldNeedsUpdate = false;
|
|
|
-
|
|
|
- force = true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- // update children
|
|
|
-
|
|
|
- for ( var i = 0, l = this.children.length; i < l; i ++ ) {
|
|
|
-
|
|
|
- this.children[ i ].updateMatrixWorld( force );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- worldPosition: function ( optionalTarget ) {
|
|
|
+ getWorldPosition: function ( optionalTarget ) {
|
|
|
|
|
|
var result = optionalTarget || new THREE.Vector3();
|
|
|
|
|
@@ -497,7 +429,7 @@ THREE.Object3D.prototype = {
|
|
|
|
|
|
},
|
|
|
|
|
|
- worldQuaternion: function () {
|
|
|
+ getWorldQuaternion: function () {
|
|
|
|
|
|
var position = new THREE.Vector3();
|
|
|
var scale = new THREE.Vector3();
|
|
@@ -516,7 +448,7 @@ THREE.Object3D.prototype = {
|
|
|
|
|
|
}(),
|
|
|
|
|
|
- worldRotation: function () {
|
|
|
+ getWorldRotation: function () {
|
|
|
|
|
|
var quaternion = new THREE.Quaternion();
|
|
|
|
|
@@ -532,7 +464,7 @@ THREE.Object3D.prototype = {
|
|
|
|
|
|
}(),
|
|
|
|
|
|
- worldScale: function () {
|
|
|
+ getWorldScale: function () {
|
|
|
|
|
|
var position = new THREE.Vector3();
|
|
|
var quaternion = new THREE.Quaternion();
|
|
@@ -551,7 +483,7 @@ THREE.Object3D.prototype = {
|
|
|
|
|
|
}(),
|
|
|
|
|
|
- worldDirection: function () {
|
|
|
+ getWorldDirection: function () {
|
|
|
|
|
|
var quaternion = new THREE.Quaternion();
|
|
|
|
|
@@ -567,6 +499,74 @@ THREE.Object3D.prototype = {
|
|
|
|
|
|
}(),
|
|
|
|
|
|
+ raycast: function () {},
|
|
|
+
|
|
|
+ traverse: function ( callback ) {
|
|
|
+
|
|
|
+ callback( this );
|
|
|
+
|
|
|
+ for ( var i = 0, l = this.children.length; i < l; i ++ ) {
|
|
|
+
|
|
|
+ this.children[ i ].traverse( callback );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ traverseVisible: function ( callback ) {
|
|
|
+
|
|
|
+ if ( this.visible === false ) return;
|
|
|
+
|
|
|
+ callback( this );
|
|
|
+
|
|
|
+ for ( var i = 0, l = this.children.length; i < l; i ++ ) {
|
|
|
+
|
|
|
+ this.children[ i ].traverseVisible( callback );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ updateMatrix: function () {
|
|
|
+
|
|
|
+ this.matrix.compose( this.position, this.quaternion, this.scale );
|
|
|
+
|
|
|
+ this.matrixWorldNeedsUpdate = true;
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ updateMatrixWorld: function ( force ) {
|
|
|
+
|
|
|
+ if ( this.matrixAutoUpdate === true ) this.updateMatrix();
|
|
|
+
|
|
|
+ if ( this.matrixWorldNeedsUpdate === true || force === true ) {
|
|
|
+
|
|
|
+ if ( this.parent === undefined ) {
|
|
|
+
|
|
|
+ this.matrixWorld.copy( this.matrix );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ this.matrixWorldNeedsUpdate = false;
|
|
|
+
|
|
|
+ force = true;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // update children
|
|
|
+
|
|
|
+ for ( var i = 0, l = this.children.length; i < l; i ++ ) {
|
|
|
+
|
|
|
+ this.children[ i ].updateMatrixWorld( force );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
toJSON: function () {
|
|
|
|
|
|
var output = {
|