|
@@ -5,7 +5,6 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
import { Matrix4 } from '../math/Matrix4.js';
|
|
import { Matrix4 } from '../math/Matrix4.js';
|
|
-import { Quaternion } from '../math/Quaternion.js';
|
|
|
|
import { Object3D } from '../core/Object3D.js';
|
|
import { Object3D } from '../core/Object3D.js';
|
|
import { Vector3 } from '../math/Vector3.js';
|
|
import { Vector3 } from '../math/Vector3.js';
|
|
|
|
|
|
@@ -37,26 +36,22 @@ Camera.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- getWorldDirection: function () {
|
|
|
|
|
|
+ getWorldDirection: function ( target ) {
|
|
|
|
|
|
- var quaternion = new Quaternion();
|
|
|
|
|
|
+ if ( target === undefined ) {
|
|
|
|
|
|
- return function getWorldDirection( target ) {
|
|
|
|
|
|
+ console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
|
|
|
|
+ target = new Vector3();
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
|
|
|
|
- target = new Vector3();
|
|
|
|
|
|
+ this.updateMatrixWorld( true );
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ var e = this.matrixWorld.elements;
|
|
|
|
|
|
- this.getWorldQuaternion( quaternion );
|
|
|
|
|
|
+ return target.set( - e[ 8 ], - e[ 9 ], - e[ 10 ] ).normalize();
|
|
|
|
|
|
- return target.set( 0, 0, - 1 ).applyQuaternion( quaternion );
|
|
|
|
-
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- }(),
|
|
|
|
|
|
+ },
|
|
|
|
|
|
updateMatrixWorld: function ( force ) {
|
|
updateMatrixWorld: function ( force ) {
|
|
|
|
|