|
@@ -1629,6 +1629,8 @@ Object.assign( Quaternion.prototype, {
|
|
|
* @author WestLangley / http://github.com/WestLangley
|
|
|
*/
|
|
|
|
|
|
+var _vector, _quaternion;
|
|
|
+
|
|
|
function Vector3( x, y, z ) {
|
|
|
|
|
|
this.x = x || 0;
|
|
@@ -1850,35 +1852,27 @@ Object.assign( Vector3.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- applyEuler: function () {
|
|
|
-
|
|
|
- var quaternion = new Quaternion();
|
|
|
-
|
|
|
- return function applyEuler( euler ) {
|
|
|
-
|
|
|
- if ( ! ( euler && euler.isEuler ) ) {
|
|
|
+ applyEuler: function ( euler ) {
|
|
|
|
|
|
- console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' );
|
|
|
-
|
|
|
- }
|
|
|
+ if ( _quaternion === undefined ) _quaternion = new Quaternion();
|
|
|
|
|
|
- return this.applyQuaternion( quaternion.setFromEuler( euler ) );
|
|
|
+ if ( ! ( euler && euler.isEuler ) ) {
|
|
|
|
|
|
- };
|
|
|
+ console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' );
|
|
|
|
|
|
- }(),
|
|
|
+ }
|
|
|
|
|
|
- applyAxisAngle: function () {
|
|
|
+ return this.applyQuaternion( _quaternion.setFromEuler( euler ) );
|
|
|
|
|
|
- var quaternion = new Quaternion();
|
|
|
+ },
|
|
|
|
|
|
- return function applyAxisAngle( axis, angle ) {
|
|
|
+ applyAxisAngle: function ( axis, angle ) {
|
|
|
|
|
|
- return this.applyQuaternion( quaternion.setFromAxisAngle( axis, angle ) );
|
|
|
+ if ( _quaternion === undefined ) _quaternion = new Quaternion();
|
|
|
|
|
|
- };
|
|
|
+ return this.applyQuaternion( _quaternion.setFromAxisAngle( axis, angle ) );
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
applyMatrix3: function ( m ) {
|
|
|
|
|
@@ -2162,34 +2156,26 @@ Object.assign( Vector3.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- projectOnPlane: function () {
|
|
|
+ projectOnPlane: function ( planeNormal ) {
|
|
|
|
|
|
- var v1 = new Vector3();
|
|
|
+ if ( _vector === undefined ) _vector = new Vector3();
|
|
|
|
|
|
- return function projectOnPlane( planeNormal ) {
|
|
|
+ _vector.copy( this ).projectOnVector( planeNormal );
|
|
|
|
|
|
- v1.copy( this ).projectOnVector( planeNormal );
|
|
|
+ return this.sub( _vector );
|
|
|
|
|
|
- return this.sub( v1 );
|
|
|
+ },
|
|
|
|
|
|
- };
|
|
|
+ reflect: function ( normal ) {
|
|
|
|
|
|
- }(),
|
|
|
-
|
|
|
- reflect: function () {
|
|
|
+ if ( _vector === undefined ) _vector = new Vector3();
|
|
|
|
|
|
// reflect incident vector off plane orthogonal to normal
|
|
|
// normal is assumed to have unit length
|
|
|
|
|
|
- var v1 = new Vector3();
|
|
|
-
|
|
|
- return function reflect( normal ) {
|
|
|
+ return this.sub( _vector.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );
|
|
|
|
|
|
- return this.sub( v1.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
angleTo: function ( v ) {
|
|
|
|
|
@@ -2343,7 +2329,7 @@ Object.assign( Vector3.prototype, {
|
|
|
* @author tschw
|
|
|
*/
|
|
|
|
|
|
-var _vector;
|
|
|
+var _vector$1;
|
|
|
|
|
|
function Matrix3() {
|
|
|
|
|
@@ -2430,17 +2416,17 @@ Object.assign( Matrix3.prototype, {
|
|
|
|
|
|
applyToBufferAttribute: function ( attribute ) {
|
|
|
|
|
|
- if ( _vector === undefined ) _vector = new Vector3();
|
|
|
+ if ( _vector$1 === undefined ) _vector$1 = new Vector3();
|
|
|
|
|
|
for ( var i = 0, l = attribute.count; i < l; i ++ ) {
|
|
|
|
|
|
- _vector.x = attribute.getX( i );
|
|
|
- _vector.y = attribute.getY( i );
|
|
|
- _vector.z = attribute.getZ( i );
|
|
|
+ _vector$1.x = attribute.getX( i );
|
|
|
+ _vector$1.y = attribute.getY( i );
|
|
|
+ _vector$1.z = attribute.getZ( i );
|
|
|
|
|
|
- _vector.applyMatrix3( this );
|
|
|
+ _vector$1.applyMatrix3( this );
|
|
|
|
|
|
- attribute.setXYZ( i, _vector.x, _vector.y, _vector.z );
|
|
|
+ attribute.setXYZ( i, _vector$1.x, _vector$1.y, _vector$1.z );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -4817,7 +4803,7 @@ Object.assign( Matrix4.prototype, {
|
|
|
* @author bhouston / http://clara.io
|
|
|
*/
|
|
|
|
|
|
-var _matrix, _quaternion;
|
|
|
+var _matrix, _quaternion$1;
|
|
|
|
|
|
function Euler( x, y, z, order ) {
|
|
|
|
|
@@ -5083,11 +5069,11 @@ Object.assign( Euler.prototype, {
|
|
|
|
|
|
// WARNING: this discards revolution information -bhouston
|
|
|
|
|
|
- if ( _quaternion === undefined ) _quaternion = new Quaternion();
|
|
|
+ if ( _quaternion$1 === undefined ) _quaternion$1 = new Quaternion();
|
|
|
|
|
|
- _quaternion.setFromEuler( this );
|
|
|
+ _quaternion$1.setFromEuler( this );
|
|
|
|
|
|
- return this.setFromQuaternion( _quaternion, newOrder );
|
|
|
+ return this.setFromQuaternion( _quaternion$1, newOrder );
|
|
|
|
|
|
},
|
|
|
|
|
@@ -7875,7 +7861,7 @@ Object.assign( Triangle.prototype, {
|
|
|
* @author mrdoob / http://mrdoob.com/
|
|
|
*/
|
|
|
|
|
|
-var ColorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,
|
|
|
+var _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,
|
|
|
'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,
|
|
|
'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,
|
|
|
'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,
|
|
@@ -7900,6 +7886,9 @@ var ColorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0
|
|
|
'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,
|
|
|
'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };
|
|
|
|
|
|
+var _hslA = { h: 0, s: 0, l: 0 };
|
|
|
+var _hslB = { h: 0, s: 0, l: 0 };
|
|
|
+
|
|
|
function Color( r, g, b ) {
|
|
|
|
|
|
if ( g === undefined && b === undefined ) {
|
|
@@ -8130,7 +8119,7 @@ Object.assign( Color.prototype, {
|
|
|
if ( style && style.length > 0 ) {
|
|
|
|
|
|
// color keywords
|
|
|
- var hex = ColorKeywords[ style ];
|
|
|
+ var hex = _colorKeywords[ style ];
|
|
|
|
|
|
if ( hex !== undefined ) {
|
|
|
|
|
@@ -8312,23 +8301,17 @@ Object.assign( Color.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- offsetHSL: function () {
|
|
|
-
|
|
|
- var hsl = {};
|
|
|
+ offsetHSL: function ( h, s, l ) {
|
|
|
|
|
|
- return function ( h, s, l ) {
|
|
|
+ this.getHSL( _hslA );
|
|
|
|
|
|
- this.getHSL( hsl );
|
|
|
+ _hslA.h += h; _hslA.s += s; _hslA.l += l;
|
|
|
|
|
|
- hsl.h += h; hsl.s += s; hsl.l += l;
|
|
|
+ this.setHSL( _hslA.h, _hslA.s, _hslA.l );
|
|
|
|
|
|
- this.setHSL( hsl.h, hsl.s, hsl.l );
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- };
|
|
|
+ return this;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
add: function ( color ) {
|
|
|
|
|
@@ -8400,27 +8383,20 @@ Object.assign( Color.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- lerpHSL: function () {
|
|
|
-
|
|
|
- var hslA = { h: 0, s: 0, l: 0 };
|
|
|
- var hslB = { h: 0, s: 0, l: 0 };
|
|
|
-
|
|
|
- return function lerpHSL( color, alpha ) {
|
|
|
+ lerpHSL: function ( color, alpha ) {
|
|
|
|
|
|
- this.getHSL( hslA );
|
|
|
- color.getHSL( hslB );
|
|
|
+ this.getHSL( _hslA );
|
|
|
+ color.getHSL( _hslB );
|
|
|
|
|
|
- var h = _Math.lerp( hslA.h, hslB.h, alpha );
|
|
|
- var s = _Math.lerp( hslA.s, hslB.s, alpha );
|
|
|
- var l = _Math.lerp( hslA.l, hslB.l, alpha );
|
|
|
+ var h = _Math.lerp( _hslA.h, _hslB.h, alpha );
|
|
|
+ var s = _Math.lerp( _hslA.s, _hslB.s, alpha );
|
|
|
+ var l = _Math.lerp( _hslA.l, _hslB.l, alpha );
|
|
|
|
|
|
- this.setHSL( h, s, l );
|
|
|
+ this.setHSL( h, s, l );
|
|
|
|
|
|
- return this;
|
|
|
-
|
|
|
- };
|
|
|
+ return this;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
equals: function ( c ) {
|
|
|
|
|
@@ -13912,6 +13888,8 @@ DataTexture.prototype.isDataTexture = true;
|
|
|
* @author bhouston / http://clara.io
|
|
|
*/
|
|
|
|
|
|
+var _vector1, _vector2, _normalMatrix;
|
|
|
+
|
|
|
function Plane( normal, constant ) {
|
|
|
|
|
|
// normal is assumed to be normalized
|
|
@@ -13952,24 +13930,24 @@ Object.assign( Plane.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- setFromCoplanarPoints: function () {
|
|
|
+ setFromCoplanarPoints: function ( a, b, c ) {
|
|
|
|
|
|
- var v1 = new Vector3();
|
|
|
- var v2 = new Vector3();
|
|
|
+ if ( _vector1 === undefined ) {
|
|
|
|
|
|
- return function setFromCoplanarPoints( a, b, c ) {
|
|
|
+ _vector1 = new Vector3();
|
|
|
+ _vector2 = new Vector3();
|
|
|
|
|
|
- var normal = v1.subVectors( c, b ).cross( v2.subVectors( a, b ) ).normalize();
|
|
|
+ }
|
|
|
|
|
|
- // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?
|
|
|
+ var normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();
|
|
|
|
|
|
- this.setFromNormalAndCoplanarPoint( normal, a );
|
|
|
+ // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?
|
|
|
|
|
|
- return this;
|
|
|
+ this.setFromNormalAndCoplanarPoint( normal, a );
|
|
|
|
|
|
- };
|
|
|
+ return this;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
clone: function () {
|
|
|
|
|
@@ -14032,50 +14010,46 @@ Object.assign( Plane.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- intersectLine: function () {
|
|
|
-
|
|
|
- var v1 = new Vector3();
|
|
|
-
|
|
|
- return function intersectLine( line, target ) {
|
|
|
+ intersectLine: function ( line, target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Plane: .intersectLine() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
+ if ( _vector1 === undefined ) _vector1 = new Vector3();
|
|
|
|
|
|
- }
|
|
|
+ if ( target === undefined ) {
|
|
|
|
|
|
- var direction = line.delta( v1 );
|
|
|
+ console.warn( 'THREE.Plane: .intersectLine() target is now required' );
|
|
|
+ target = new Vector3();
|
|
|
|
|
|
- var denominator = this.normal.dot( direction );
|
|
|
+ }
|
|
|
|
|
|
- if ( denominator === 0 ) {
|
|
|
+ var direction = line.delta( _vector1 );
|
|
|
|
|
|
- // line is coplanar, return origin
|
|
|
- if ( this.distanceToPoint( line.start ) === 0 ) {
|
|
|
+ var denominator = this.normal.dot( direction );
|
|
|
|
|
|
- return target.copy( line.start );
|
|
|
+ if ( denominator === 0 ) {
|
|
|
|
|
|
- }
|
|
|
+ // line is coplanar, return origin
|
|
|
+ if ( this.distanceToPoint( line.start ) === 0 ) {
|
|
|
|
|
|
- // Unsure if this is the correct method to handle this case.
|
|
|
- return undefined;
|
|
|
+ return target.copy( line.start );
|
|
|
|
|
|
}
|
|
|
|
|
|
- var t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;
|
|
|
+ // Unsure if this is the correct method to handle this case.
|
|
|
+ return undefined;
|
|
|
|
|
|
- if ( t < 0 || t > 1 ) {
|
|
|
+ }
|
|
|
|
|
|
- return undefined;
|
|
|
+ var t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;
|
|
|
|
|
|
- }
|
|
|
+ if ( t < 0 || t > 1 ) {
|
|
|
|
|
|
- return target.copy( direction ).multiplyScalar( t ).add( line.start );
|
|
|
+ return undefined;
|
|
|
|
|
|
- };
|
|
|
+ }
|
|
|
|
|
|
- }(),
|
|
|
+ return target.copy( direction ).multiplyScalar( t ).add( line.start );
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
intersectsLine: function ( line ) {
|
|
|
|
|
@@ -14113,26 +14087,26 @@ Object.assign( Plane.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- applyMatrix4: function () {
|
|
|
+ applyMatrix4: function ( matrix, optionalNormalMatrix ) {
|
|
|
|
|
|
- var v1 = new Vector3();
|
|
|
- var m1 = new Matrix3();
|
|
|
+ if ( _normalMatrix === undefined ) {
|
|
|
|
|
|
- return function applyMatrix4( matrix, optionalNormalMatrix ) {
|
|
|
+ _normalMatrix = new Matrix3();
|
|
|
+ _vector1 = new Vector3();
|
|
|
|
|
|
- var normalMatrix = optionalNormalMatrix || m1.getNormalMatrix( matrix );
|
|
|
+ }
|
|
|
|
|
|
- var referencePoint = this.coplanarPoint( v1 ).applyMatrix4( matrix );
|
|
|
+ var normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );
|
|
|
|
|
|
- var normal = this.normal.applyMatrix3( normalMatrix ).normalize();
|
|
|
+ var referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );
|
|
|
|
|
|
- this.constant = - referencePoint.dot( normal );
|
|
|
+ var normal = this.normal.applyMatrix3( normalMatrix ).normalize();
|
|
|
|
|
|
- return this;
|
|
|
+ this.constant = - referencePoint.dot( normal );
|
|
|
|
|
|
- };
|
|
|
+ return this;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
translate: function ( offset ) {
|
|
|
|
|
@@ -14156,6 +14130,9 @@ Object.assign( Plane.prototype, {
|
|
|
* @author bhouston / http://clara.io
|
|
|
*/
|
|
|
|
|
|
+var _sphere;
|
|
|
+var _vector$2;
|
|
|
+
|
|
|
function Frustum( p0, p1, p2, p3, p4, p5 ) {
|
|
|
|
|
|
this.planes = [
|
|
@@ -14228,41 +14205,29 @@ Object.assign( Frustum.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- intersectsObject: function () {
|
|
|
-
|
|
|
- var sphere = new Sphere();
|
|
|
-
|
|
|
- return function intersectsObject( object ) {
|
|
|
-
|
|
|
- var geometry = object.geometry;
|
|
|
+ intersectsObject: function ( object ) {
|
|
|
|
|
|
- if ( geometry.boundingSphere === null )
|
|
|
- geometry.computeBoundingSphere();
|
|
|
+ if ( _sphere === undefined ) _sphere = new Sphere();
|
|
|
|
|
|
- sphere.copy( geometry.boundingSphere )
|
|
|
- .applyMatrix4( object.matrixWorld );
|
|
|
-
|
|
|
- return this.intersectsSphere( sphere );
|
|
|
-
|
|
|
- };
|
|
|
+ var geometry = object.geometry;
|
|
|
|
|
|
- }(),
|
|
|
+ if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
|
|
|
|
|
|
- intersectsSprite: function () {
|
|
|
+ _sphere.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
|
|
|
|
|
|
- var sphere = new Sphere();
|
|
|
+ return this.intersectsSphere( _sphere );
|
|
|
|
|
|
- return function intersectsSprite( sprite ) {
|
|
|
+ },
|
|
|
|
|
|
- sphere.center.set( 0, 0, 0 );
|
|
|
- sphere.radius = 0.7071067811865476;
|
|
|
- sphere.applyMatrix4( sprite.matrixWorld );
|
|
|
+ intersectsSprite: function ( sprite ) {
|
|
|
|
|
|
- return this.intersectsSphere( sphere );
|
|
|
+ _sphere.center.set( 0, 0, 0 );
|
|
|
+ _sphere.radius = 0.7071067811865476;
|
|
|
+ _sphere.applyMatrix4( sprite.matrixWorld );
|
|
|
|
|
|
- };
|
|
|
+ return this.intersectsSphere( _sphere );
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
intersectsSphere: function ( sphere ) {
|
|
|
|
|
@@ -14286,37 +14251,33 @@ Object.assign( Frustum.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- intersectsBox: function () {
|
|
|
-
|
|
|
- var p = new Vector3();
|
|
|
-
|
|
|
- return function intersectsBox( box ) {
|
|
|
+ intersectsBox: function ( box ) {
|
|
|
|
|
|
- var planes = this.planes;
|
|
|
+ if ( _vector$2 === undefined ) _vector$2 = new Vector3();
|
|
|
|
|
|
- for ( var i = 0; i < 6; i ++ ) {
|
|
|
+ var planes = this.planes;
|
|
|
|
|
|
- var plane = planes[ i ];
|
|
|
+ for ( var i = 0; i < 6; i ++ ) {
|
|
|
|
|
|
- // corner at max distance
|
|
|
+ var plane = planes[ i ];
|
|
|
|
|
|
- p.x = plane.normal.x > 0 ? box.max.x : box.min.x;
|
|
|
- p.y = plane.normal.y > 0 ? box.max.y : box.min.y;
|
|
|
- p.z = plane.normal.z > 0 ? box.max.z : box.min.z;
|
|
|
+ // corner at max distance
|
|
|
|
|
|
- if ( plane.distanceToPoint( p ) < 0 ) {
|
|
|
+ _vector$2.x = plane.normal.x > 0 ? box.max.x : box.min.x;
|
|
|
+ _vector$2.y = plane.normal.y > 0 ? box.max.y : box.min.y;
|
|
|
+ _vector$2.z = plane.normal.z > 0 ? box.max.z : box.min.z;
|
|
|
|
|
|
- return false;
|
|
|
+ if ( plane.distanceToPoint( _vector$2 ) < 0 ) {
|
|
|
|
|
|
- }
|
|
|
+ return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
- return true;
|
|
|
+ }
|
|
|
|
|
|
- };
|
|
|
+ return true;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
containsPoint: function ( point ) {
|
|
|
|
|
@@ -44961,6 +44922,8 @@ Object.assign( Cylindrical.prototype, {
|
|
|
* @author bhouston / http://clara.io
|
|
|
*/
|
|
|
|
|
|
+var _vector$3;
|
|
|
+
|
|
|
function Box2( min, max ) {
|
|
|
|
|
|
this.min = ( min !== undefined ) ? min : new Vector2( + Infinity, + Infinity );
|
|
@@ -44993,21 +44956,17 @@ Object.assign( Box2.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- setFromCenterAndSize: function () {
|
|
|
-
|
|
|
- var v1 = new Vector2();
|
|
|
-
|
|
|
- return function setFromCenterAndSize( center, size ) {
|
|
|
+ setFromCenterAndSize: function ( center, size ) {
|
|
|
|
|
|
- var halfSize = v1.copy( size ).multiplyScalar( 0.5 );
|
|
|
- this.min.copy( center ).sub( halfSize );
|
|
|
- this.max.copy( center ).add( halfSize );
|
|
|
+ if ( _vector$3 === undefined ) _vector$3 = new Vector2();
|
|
|
|
|
|
- return this;
|
|
|
+ var halfSize = _vector$3.copy( size ).multiplyScalar( 0.5 );
|
|
|
+ this.min.copy( center ).sub( halfSize );
|
|
|
+ this.max.copy( center ).add( halfSize );
|
|
|
|
|
|
- };
|
|
|
+ return this;
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
clone: function () {
|
|
|
|
|
@@ -45149,18 +45108,14 @@ Object.assign( Box2.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- distanceToPoint: function () {
|
|
|
-
|
|
|
- var v1 = new Vector2();
|
|
|
+ distanceToPoint: function ( point ) {
|
|
|
|
|
|
- return function distanceToPoint( point ) {
|
|
|
+ if ( _vector$3 === undefined ) _vector$3 = new Vector2();
|
|
|
|
|
|
- var clampedPoint = v1.copy( point ).clamp( this.min, this.max );
|
|
|
- return clampedPoint.sub( point ).length();
|
|
|
+ var clampedPoint = _vector$3.copy( point ).clamp( this.min, this.max );
|
|
|
+ return clampedPoint.sub( point ).length();
|
|
|
|
|
|
- };
|
|
|
-
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
intersect: function ( box ) {
|
|
|
|