123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /**
- * @author alteredq / http://alteredqualia.com/
- */
- THREE.Gyroscope = function () {
- THREE.Object3D.call( this );
- };
- THREE.Gyroscope.prototype = Object.create( THREE.Object3D.prototype );
- THREE.Gyroscope.prototype.updateMatrixWorld = function ( force ) {
- this.matrixAutoUpdate && this.updateMatrix();
- // update matrixWorld
- if ( this.matrixWorldNeedsUpdate || force ) {
- if ( this.parent ) {
- this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
- this.matrixWorld.decompose( this.translationWorld, this.quaternionWorld, this.scaleWorld );
- this.matrix.decompose( this.translationObject, this.quaternionObject, this.scaleObject );
- this.matrixWorld.compose( this.translationWorld, this.quaternionObject, this.scaleWorld );
- } else {
- this.matrixWorld.copy( 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 );
- }
- };
- THREE.Gyroscope.prototype.translationWorld = new THREE.Vector3();
- THREE.Gyroscope.prototype.translationObject = new THREE.Vector3();
- THREE.Gyroscope.prototype.quaternionWorld = new THREE.Quaternion();
- THREE.Gyroscope.prototype.quaternionObject = new THREE.Quaternion();
- THREE.Gyroscope.prototype.scaleWorld = new THREE.Vector3();
- THREE.Gyroscope.prototype.scaleObject = new THREE.Vector3();
|