|
@@ -5180,6 +5180,8 @@ var _object3DId = 0;
|
|
var _m1$1, _q1, _v1$1;
|
|
var _m1$1, _q1, _v1$1;
|
|
var _xAxis, _yAxis, _zAxis;
|
|
var _xAxis, _yAxis, _zAxis;
|
|
var _target, _position, _scale, _quaternion$2;
|
|
var _target, _position, _scale, _quaternion$2;
|
|
|
|
+var _addedEvent = { type: 'added' };
|
|
|
|
+var _removedEvent = { type: 'removed' };
|
|
|
|
|
|
function Object3D() {
|
|
function Object3D() {
|
|
|
|
|
|
@@ -5435,7 +5437,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
|
|
|
|
|
|
// This method does not support objects having non-uniformly-scaled parent(s)
|
|
// This method does not support objects having non-uniformly-scaled parent(s)
|
|
|
|
|
|
- if ( _position === undefined ) {
|
|
|
|
|
|
+ if ( _target === undefined ) {
|
|
|
|
|
|
_q1 = new Quaternion();
|
|
_q1 = new Quaternion();
|
|
_m1$1 = new Matrix4();
|
|
_m1$1 = new Matrix4();
|
|
@@ -5514,7 +5516,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
|
|
object.parent = this;
|
|
object.parent = this;
|
|
this.children.push( object );
|
|
this.children.push( object );
|
|
|
|
|
|
- object.dispatchEvent( { type: 'added' } );
|
|
|
|
|
|
+ object.dispatchEvent( _addedEvent );
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
@@ -5547,7 +5549,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
|
|
object.parent = null;
|
|
object.parent = null;
|
|
this.children.splice( index, 1 );
|
|
this.children.splice( index, 1 );
|
|
|
|
|
|
- object.dispatchEvent( { type: 'removed' } );
|
|
|
|
|
|
+ object.dispatchEvent( _removedEvent );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -27099,7 +27101,7 @@ PointsMaterial.prototype.copy = function ( source ) {
|
|
* @author alteredq / http://alteredqualia.com/
|
|
* @author alteredq / http://alteredqualia.com/
|
|
*/
|
|
*/
|
|
|
|
|
|
-var _inverseMatrix$2, _ray$2, _sphere$3;
|
|
|
|
|
|
+var _inverseMatrix$2, _ray$2, _sphere$3, _position$1;
|
|
|
|
|
|
function Points( geometry, material ) {
|
|
function Points( geometry, material ) {
|
|
|
|
|
|
@@ -27127,10 +27129,10 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
_inverseMatrix$2 = new Matrix4();
|
|
_inverseMatrix$2 = new Matrix4();
|
|
_ray$2 = new Ray();
|
|
_ray$2 = new Ray();
|
|
_sphere$3 = new Sphere();
|
|
_sphere$3 = new Sphere();
|
|
|
|
+ _position$1 = new Vector3();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- var object = this;
|
|
|
|
var geometry = this.geometry;
|
|
var geometry = this.geometry;
|
|
var matrixWorld = this.matrixWorld;
|
|
var matrixWorld = this.matrixWorld;
|
|
var threshold = raycaster.params.Points.threshold;
|
|
var threshold = raycaster.params.Points.threshold;
|
|
@@ -27152,36 +27154,6 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
var localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );
|
|
var localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );
|
|
var localThresholdSq = localThreshold * localThreshold;
|
|
var localThresholdSq = localThreshold * localThreshold;
|
|
- var position = new Vector3();
|
|
|
|
- var intersectPoint = new Vector3();
|
|
|
|
-
|
|
|
|
- function testPoint( point, index ) {
|
|
|
|
-
|
|
|
|
- var rayPointDistanceSq = _ray$2.distanceSqToPoint( point );
|
|
|
|
-
|
|
|
|
- if ( rayPointDistanceSq < localThresholdSq ) {
|
|
|
|
-
|
|
|
|
- _ray$2.closestPointToPoint( point, intersectPoint );
|
|
|
|
- intersectPoint.applyMatrix4( matrixWorld );
|
|
|
|
-
|
|
|
|
- var distance = raycaster.ray.origin.distanceTo( intersectPoint );
|
|
|
|
-
|
|
|
|
- if ( distance < raycaster.near || distance > raycaster.far ) return;
|
|
|
|
-
|
|
|
|
- intersects.push( {
|
|
|
|
-
|
|
|
|
- distance: distance,
|
|
|
|
- distanceToRay: Math.sqrt( rayPointDistanceSq ),
|
|
|
|
- point: intersectPoint.clone(),
|
|
|
|
- index: index,
|
|
|
|
- face: null,
|
|
|
|
- object: object
|
|
|
|
-
|
|
|
|
- } );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
|
|
if ( geometry.isBufferGeometry ) {
|
|
if ( geometry.isBufferGeometry ) {
|
|
|
|
|
|
@@ -27197,9 +27169,9 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
var a = indices[ i ];
|
|
var a = indices[ i ];
|
|
|
|
|
|
- position.fromArray( positions, a * 3 );
|
|
|
|
|
|
+ _position$1.fromArray( positions, a * 3 );
|
|
|
|
|
|
- testPoint( position, a );
|
|
|
|
|
|
+ testPoint( _position$1, a, localThresholdSq, matrixWorld, raycaster, intersects, this );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -27207,9 +27179,9 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
for ( var i = 0, l = positions.length / 3; i < l; i ++ ) {
|
|
for ( var i = 0, l = positions.length / 3; i < l; i ++ ) {
|
|
|
|
|
|
- position.fromArray( positions, i * 3 );
|
|
|
|
|
|
+ _position$1.fromArray( positions, i * 3 );
|
|
|
|
|
|
- testPoint( position, i );
|
|
|
|
|
|
+ testPoint( _position$1, i, localThresholdSq, matrixWorld, raycaster, intersects, this );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -27221,7 +27193,7 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
for ( var i = 0, l = vertices.length; i < l; i ++ ) {
|
|
for ( var i = 0, l = vertices.length; i < l; i ++ ) {
|
|
|
|
|
|
- testPoint( vertices[ i ], i );
|
|
|
|
|
|
+ testPoint( vertices[ i ], i, localThresholdSq, matrixWorld, raycaster, intersects, this );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -27283,6 +27255,36 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
+function testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) {
|
|
|
|
+
|
|
|
|
+ var rayPointDistanceSq = _ray$2.distanceSqToPoint( point );
|
|
|
|
+
|
|
|
|
+ if ( rayPointDistanceSq < localThresholdSq ) {
|
|
|
|
+
|
|
|
|
+ var intersectPoint = new Vector3();
|
|
|
|
+
|
|
|
|
+ _ray$2.closestPointToPoint( point, intersectPoint );
|
|
|
|
+ intersectPoint.applyMatrix4( matrixWorld );
|
|
|
|
+
|
|
|
|
+ var distance = raycaster.ray.origin.distanceTo( intersectPoint );
|
|
|
|
+
|
|
|
|
+ if ( distance < raycaster.near || distance > raycaster.far ) return;
|
|
|
|
+
|
|
|
|
+ intersects.push( {
|
|
|
|
+
|
|
|
|
+ distance: distance,
|
|
|
|
+ distanceToRay: Math.sqrt( rayPointDistanceSq ),
|
|
|
|
+ point: intersectPoint,
|
|
|
|
+ index: index,
|
|
|
|
+ face: null,
|
|
|
|
+ object: object
|
|
|
|
+
|
|
|
|
+ } );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @author mrdoob / http://mrdoob.com/
|
|
* @author mrdoob / http://mrdoob.com/
|
|
*/
|
|
*/
|
|
@@ -41160,7 +41162,7 @@ Object.assign( Clock.prototype, {
|
|
* @author mrdoob / http://mrdoob.com/
|
|
* @author mrdoob / http://mrdoob.com/
|
|
*/
|
|
*/
|
|
|
|
|
|
-var _position$1, _quaternion$3, _scale$1;
|
|
|
|
|
|
+var _position$2, _quaternion$3, _scale$1;
|
|
var _orientation;
|
|
var _orientation;
|
|
|
|
|
|
function AudioListener() {
|
|
function AudioListener() {
|
|
@@ -41254,9 +41256,9 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
Object3D.prototype.updateMatrixWorld.call( this, force );
|
|
Object3D.prototype.updateMatrixWorld.call( this, force );
|
|
|
|
|
|
- if ( _position$1 === undefined ) {
|
|
|
|
|
|
+ if ( _position$2 === undefined ) {
|
|
|
|
|
|
- _position$1 = new Vector3();
|
|
|
|
|
|
+ _position$2 = new Vector3();
|
|
_quaternion$3 = new Quaternion();
|
|
_quaternion$3 = new Quaternion();
|
|
_scale$1 = new Vector3();
|
|
_scale$1 = new Vector3();
|
|
_orientation = new Vector3();
|
|
_orientation = new Vector3();
|
|
@@ -41268,7 +41270,7 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
this.timeDelta = this._clock.getDelta();
|
|
this.timeDelta = this._clock.getDelta();
|
|
|
|
|
|
- this.matrixWorld.decompose( _position$1, _quaternion$3, _scale$1 );
|
|
|
|
|
|
+ this.matrixWorld.decompose( _position$2, _quaternion$3, _scale$1 );
|
|
|
|
|
|
_orientation.set( 0, 0, - 1 ).applyQuaternion( _quaternion$3 );
|
|
_orientation.set( 0, 0, - 1 ).applyQuaternion( _quaternion$3 );
|
|
|
|
|
|
@@ -41278,9 +41280,9 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
var endTime = this.context.currentTime + this.timeDelta;
|
|
var endTime = this.context.currentTime + this.timeDelta;
|
|
|
|
|
|
- listener.positionX.linearRampToValueAtTime( _position$1.x, endTime );
|
|
|
|
- listener.positionY.linearRampToValueAtTime( _position$1.y, endTime );
|
|
|
|
- listener.positionZ.linearRampToValueAtTime( _position$1.z, endTime );
|
|
|
|
|
|
+ listener.positionX.linearRampToValueAtTime( _position$2.x, endTime );
|
|
|
|
+ listener.positionY.linearRampToValueAtTime( _position$2.y, endTime );
|
|
|
|
+ listener.positionZ.linearRampToValueAtTime( _position$2.z, endTime );
|
|
listener.forwardX.linearRampToValueAtTime( _orientation.x, endTime );
|
|
listener.forwardX.linearRampToValueAtTime( _orientation.x, endTime );
|
|
listener.forwardY.linearRampToValueAtTime( _orientation.y, endTime );
|
|
listener.forwardY.linearRampToValueAtTime( _orientation.y, endTime );
|
|
listener.forwardZ.linearRampToValueAtTime( _orientation.z, endTime );
|
|
listener.forwardZ.linearRampToValueAtTime( _orientation.z, endTime );
|
|
@@ -41290,7 +41292,7 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
- listener.setPosition( _position$1.x, _position$1.y, _position$1.z );
|
|
|
|
|
|
+ listener.setPosition( _position$2.x, _position$2.y, _position$2.z );
|
|
listener.setOrientation( _orientation.x, _orientation.y, _orientation.z, up.x, up.y, up.z );
|
|
listener.setOrientation( _orientation.x, _orientation.y, _orientation.z, up.x, up.y, up.z );
|
|
|
|
|
|
}
|
|
}
|
|
@@ -41645,7 +41647,7 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
* @author mrdoob / http://mrdoob.com/
|
|
* @author mrdoob / http://mrdoob.com/
|
|
*/
|
|
*/
|
|
|
|
|
|
-var _position$2, _quaternion$4, _scale$2;
|
|
|
|
|
|
+var _position$3, _quaternion$4, _scale$2;
|
|
var _orientation$1;
|
|
var _orientation$1;
|
|
|
|
|
|
function PositionalAudio( listener ) {
|
|
function PositionalAudio( listener ) {
|
|
@@ -41738,9 +41740,9 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {
|
|
|
|
|
|
Object3D.prototype.updateMatrixWorld.call( this, force );
|
|
Object3D.prototype.updateMatrixWorld.call( this, force );
|
|
|
|
|
|
- if ( _position$2 === undefined ) {
|
|
|
|
|
|
+ if ( _position$3 === undefined ) {
|
|
|
|
|
|
- _position$2 = new Vector3();
|
|
|
|
|
|
+ _position$3 = new Vector3();
|
|
_quaternion$4 = new Quaternion();
|
|
_quaternion$4 = new Quaternion();
|
|
_scale$2 = new Vector3();
|
|
_scale$2 = new Vector3();
|
|
_orientation$1 = new Vector3();
|
|
_orientation$1 = new Vector3();
|
|
@@ -41749,7 +41751,7 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {
|
|
|
|
|
|
if ( this.hasPlaybackControl === true && this.isPlaying === false ) return;
|
|
if ( this.hasPlaybackControl === true && this.isPlaying === false ) return;
|
|
|
|
|
|
- this.matrixWorld.decompose( _position$2, _quaternion$4, _scale$2 );
|
|
|
|
|
|
+ this.matrixWorld.decompose( _position$3, _quaternion$4, _scale$2 );
|
|
|
|
|
|
_orientation$1.set( 0, 0, 1 ).applyQuaternion( _quaternion$4 );
|
|
_orientation$1.set( 0, 0, 1 ).applyQuaternion( _quaternion$4 );
|
|
|
|
|
|
@@ -41761,16 +41763,16 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), {
|
|
|
|
|
|
var endTime = this.context.currentTime + this.listener.timeDelta;
|
|
var endTime = this.context.currentTime + this.listener.timeDelta;
|
|
|
|
|
|
- panner.positionX.linearRampToValueAtTime( _position$2.x, endTime );
|
|
|
|
- panner.positionY.linearRampToValueAtTime( _position$2.y, endTime );
|
|
|
|
- panner.positionZ.linearRampToValueAtTime( _position$2.z, endTime );
|
|
|
|
|
|
+ panner.positionX.linearRampToValueAtTime( _position$3.x, endTime );
|
|
|
|
+ panner.positionY.linearRampToValueAtTime( _position$3.y, endTime );
|
|
|
|
+ panner.positionZ.linearRampToValueAtTime( _position$3.z, endTime );
|
|
panner.orientationX.linearRampToValueAtTime( _orientation$1.x, endTime );
|
|
panner.orientationX.linearRampToValueAtTime( _orientation$1.x, endTime );
|
|
panner.orientationY.linearRampToValueAtTime( _orientation$1.y, endTime );
|
|
panner.orientationY.linearRampToValueAtTime( _orientation$1.y, endTime );
|
|
panner.orientationZ.linearRampToValueAtTime( _orientation$1.z, endTime );
|
|
panner.orientationZ.linearRampToValueAtTime( _orientation$1.z, endTime );
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
- panner.setPosition( _position$2.x, _position$2.y, _position$2.z );
|
|
|
|
|
|
+ panner.setPosition( _position$3.x, _position$3.y, _position$3.z );
|
|
panner.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z );
|
|
panner.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z );
|
|
|
|
|
|
}
|
|
}
|