|
@@ -4160,26 +4160,12 @@ class Box3 {
|
|
|
|
|
|
getCenter( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Box3: .getCenter() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );
|
|
|
|
|
|
}
|
|
|
|
|
|
getSize( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Box3: .getSize() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min );
|
|
|
|
|
|
}
|
|
@@ -4268,13 +4254,6 @@ class Box3 {
|
|
|
// This can potentially have a divide by zero if the box
|
|
|
// has a size dimension of 0.
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Box3: .getParameter() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.set(
|
|
|
( point.x - this.min.x ) / ( this.max.x - this.min.x ),
|
|
|
( point.y - this.min.y ) / ( this.max.y - this.min.y ),
|
|
@@ -4404,13 +4383,6 @@ class Box3 {
|
|
|
|
|
|
clampPoint( point, target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Box3: .clampPoint() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.copy( point ).clamp( this.min, this.max );
|
|
|
|
|
|
}
|
|
@@ -4425,13 +4397,6 @@ class Box3 {
|
|
|
|
|
|
getBoundingSphere( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.error( 'THREE.Box3: .getBoundingSphere() target is now required' );
|
|
|
- //target = new Sphere(); // removed to avoid cyclic dependency
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
this.getCenter( target.center );
|
|
|
|
|
|
target.radius = this.getSize( _vector$b ).length() * 0.5;
|
|
@@ -4670,13 +4635,6 @@ class Sphere {
|
|
|
|
|
|
const deltaLengthSq = this.center.distanceToSquared( point );
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Sphere: .clampPoint() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
target.copy( point );
|
|
|
|
|
|
if ( deltaLengthSq > ( this.radius * this.radius ) ) {
|
|
@@ -4692,13 +4650,6 @@ class Sphere {
|
|
|
|
|
|
getBoundingBox( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Sphere: .getBoundingBox() target is now required' );
|
|
|
- target = new Box3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
if ( this.isEmpty() ) {
|
|
|
|
|
|
// Empty sphere produces empty bounding box
|
|
@@ -4826,13 +4777,6 @@ class Ray {
|
|
|
|
|
|
at( t, target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Ray: .at() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.copy( this.direction ).multiplyScalar( t ).add( this.origin );
|
|
|
|
|
|
}
|
|
@@ -4855,13 +4799,6 @@ class Ray {
|
|
|
|
|
|
closestPointToPoint( point, target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Ray: .closestPointToPoint() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
target.subVectors( point, this.origin );
|
|
|
|
|
|
const directionDistance = target.dot( this.direction );
|
|
@@ -6999,13 +6936,6 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
getWorldPosition( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Object3D: .getWorldPosition() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
this.updateWorldMatrix( true, false );
|
|
|
|
|
|
return target.setFromMatrixPosition( this.matrixWorld );
|
|
@@ -7014,13 +6944,6 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
getWorldQuaternion( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required' );
|
|
|
- target = new Quaternion();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
this.updateWorldMatrix( true, false );
|
|
|
|
|
|
this.matrixWorld.decompose( _position$3, target, _scale$2 );
|
|
@@ -7031,13 +6954,6 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
getWorldScale( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Object3D: .getWorldScale() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
this.updateWorldMatrix( true, false );
|
|
|
|
|
|
this.matrixWorld.decompose( _position$3, _quaternion$2, target );
|
|
@@ -7048,13 +6964,6 @@ class Object3D extends EventDispatcher {
|
|
|
|
|
|
getWorldDirection( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
this.updateWorldMatrix( true, false );
|
|
|
|
|
|
const e = this.matrixWorld.elements;
|
|
@@ -7462,228 +7371,6 @@ Object3D.DefaultMatrixAutoUpdate = true;
|
|
|
|
|
|
Object3D.prototype.isObject3D = true;
|
|
|
|
|
|
-const _vector1 = /*@__PURE__*/ new Vector3();
|
|
|
-const _vector2$1 = /*@__PURE__*/ new Vector3();
|
|
|
-const _normalMatrix = /*@__PURE__*/ new Matrix3();
|
|
|
-
|
|
|
-class Plane {
|
|
|
-
|
|
|
- constructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {
|
|
|
-
|
|
|
- // normal is assumed to be normalized
|
|
|
-
|
|
|
- this.normal = normal;
|
|
|
- this.constant = constant;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- set( normal, constant ) {
|
|
|
-
|
|
|
- this.normal.copy( normal );
|
|
|
- this.constant = constant;
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- setComponents( x, y, z, w ) {
|
|
|
-
|
|
|
- this.normal.set( x, y, z );
|
|
|
- this.constant = w;
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- setFromNormalAndCoplanarPoint( normal, point ) {
|
|
|
-
|
|
|
- this.normal.copy( normal );
|
|
|
- this.constant = - point.dot( this.normal );
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- setFromCoplanarPoints( a, b, c ) {
|
|
|
-
|
|
|
- const normal = _vector1.subVectors( c, b ).cross( _vector2$1.subVectors( a, b ) ).normalize();
|
|
|
-
|
|
|
- // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?
|
|
|
-
|
|
|
- this.setFromNormalAndCoplanarPoint( normal, a );
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- copy( plane ) {
|
|
|
-
|
|
|
- this.normal.copy( plane.normal );
|
|
|
- this.constant = plane.constant;
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- normalize() {
|
|
|
-
|
|
|
- // Note: will lead to a divide by zero if the plane is invalid.
|
|
|
-
|
|
|
- const inverseNormalLength = 1.0 / this.normal.length();
|
|
|
- this.normal.multiplyScalar( inverseNormalLength );
|
|
|
- this.constant *= inverseNormalLength;
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- negate() {
|
|
|
-
|
|
|
- this.constant *= - 1;
|
|
|
- this.normal.negate();
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- distanceToPoint( point ) {
|
|
|
-
|
|
|
- return this.normal.dot( point ) + this.constant;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- distanceToSphere( sphere ) {
|
|
|
-
|
|
|
- return this.distanceToPoint( sphere.center ) - sphere.radius;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- projectPoint( point, target ) {
|
|
|
-
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Plane: .projectPoint() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return target.copy( this.normal ).multiplyScalar( - this.distanceToPoint( point ) ).add( point );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- intersectLine( line, target ) {
|
|
|
-
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Plane: .intersectLine() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- const direction = line.delta( _vector1 );
|
|
|
-
|
|
|
- const denominator = this.normal.dot( direction );
|
|
|
-
|
|
|
- if ( denominator === 0 ) {
|
|
|
-
|
|
|
- // line is coplanar, return origin
|
|
|
- if ( this.distanceToPoint( line.start ) === 0 ) {
|
|
|
-
|
|
|
- return target.copy( line.start );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- // Unsure if this is the correct method to handle this case.
|
|
|
- return null;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- const t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;
|
|
|
-
|
|
|
- if ( t < 0 || t > 1 ) {
|
|
|
-
|
|
|
- return null;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return target.copy( direction ).multiplyScalar( t ).add( line.start );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- intersectsLine( line ) {
|
|
|
-
|
|
|
- // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.
|
|
|
-
|
|
|
- const startSign = this.distanceToPoint( line.start );
|
|
|
- const endSign = this.distanceToPoint( line.end );
|
|
|
-
|
|
|
- return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- intersectsBox( box ) {
|
|
|
-
|
|
|
- return box.intersectsPlane( this );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- intersectsSphere( sphere ) {
|
|
|
-
|
|
|
- return sphere.intersectsPlane( this );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- coplanarPoint( target ) {
|
|
|
-
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Plane: .coplanarPoint() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return target.copy( this.normal ).multiplyScalar( - this.constant );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- applyMatrix4( matrix, optionalNormalMatrix ) {
|
|
|
-
|
|
|
- const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );
|
|
|
-
|
|
|
- const referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );
|
|
|
-
|
|
|
- const normal = this.normal.applyMatrix3( normalMatrix ).normalize();
|
|
|
-
|
|
|
- this.constant = - referencePoint.dot( normal );
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- translate( offset ) {
|
|
|
-
|
|
|
- this.constant -= offset.dot( this.normal );
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- equals( plane ) {
|
|
|
-
|
|
|
- return plane.normal.equals( this.normal ) && ( plane.constant === this.constant );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- clone() {
|
|
|
-
|
|
|
- return new this.constructor().copy( this );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-Plane.prototype.isPlane = true;
|
|
|
-
|
|
|
const _v0$1 = /*@__PURE__*/ new Vector3();
|
|
|
const _v1$3 = /*@__PURE__*/ new Vector3();
|
|
|
const _v2$2 = /*@__PURE__*/ new Vector3();
|
|
@@ -7708,13 +7395,6 @@ class Triangle {
|
|
|
|
|
|
static getNormal( a, b, c, target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Triangle: .getNormal() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
target.subVectors( c, b );
|
|
|
_v0$1.subVectors( a, b );
|
|
|
target.cross( _v0$1 );
|
|
@@ -7746,13 +7426,6 @@ class Triangle {
|
|
|
|
|
|
const denom = ( dot00 * dot11 - dot01 * dot01 );
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Triangle: .getBarycoord() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
// collinear or singular triangle
|
|
|
if ( denom === 0 ) {
|
|
|
|
|
@@ -7849,13 +7522,6 @@ class Triangle {
|
|
|
|
|
|
getMidpoint( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Triangle: .getMidpoint() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );
|
|
|
|
|
|
}
|
|
@@ -7868,13 +7534,6 @@ class Triangle {
|
|
|
|
|
|
getPlane( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Triangle: .getPlane() target is now required' );
|
|
|
- target = new Plane();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.setFromCoplanarPoints( this.a, this.b, this.c );
|
|
|
|
|
|
}
|
|
@@ -7911,13 +7570,6 @@ class Triangle {
|
|
|
|
|
|
closestPointToPoint( p, target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Triangle: .closestPointToPoint() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
const a = this.a, b = this.b, c = this.c;
|
|
|
let v, w;
|
|
|
|
|
@@ -8852,13 +8504,6 @@ class Color {
|
|
|
|
|
|
// h,s,l ranges are in 0.0 - 1.0
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Color: .getHSL() target is now required' );
|
|
|
- target = { h: 0, s: 0, l: 0 };
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
const r = this.r, g = this.g, b = this.b;
|
|
|
|
|
|
const max = Math.max( r, g, b );
|
|
@@ -9180,7 +8825,7 @@ class MeshBasicMaterial extends Material {
|
|
|
MeshBasicMaterial.prototype.isMeshBasicMaterial = true;
|
|
|
|
|
|
const _vector$9 = /*@__PURE__*/ new Vector3();
|
|
|
-const _vector2 = /*@__PURE__*/ new Vector2();
|
|
|
+const _vector2$1 = /*@__PURE__*/ new Vector2();
|
|
|
|
|
|
class BufferAttribute {
|
|
|
|
|
@@ -9369,10 +9014,10 @@ class BufferAttribute {
|
|
|
|
|
|
for ( let i = 0, l = this.count; i < l; i ++ ) {
|
|
|
|
|
|
- _vector2.fromBufferAttribute( this, i );
|
|
|
- _vector2.applyMatrix3( m );
|
|
|
+ _vector2$1.fromBufferAttribute( this, i );
|
|
|
+ _vector2$1.applyMatrix3( m );
|
|
|
|
|
|
- this.setXY( i, _vector2.x, _vector2.y );
|
|
|
+ this.setXY( i, _vector2$1.x, _vector2$1.y );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -11722,13 +11367,6 @@ class Camera extends Object3D {
|
|
|
|
|
|
getWorldDirection( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
this.updateWorldMatrix( true, false );
|
|
|
|
|
|
const e = this.matrixWorld.elements;
|
|
@@ -12272,6 +11910,207 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
|
|
|
|
|
|
WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;
|
|
|
|
|
|
+const _vector1 = /*@__PURE__*/ new Vector3();
|
|
|
+const _vector2 = /*@__PURE__*/ new Vector3();
|
|
|
+const _normalMatrix = /*@__PURE__*/ new Matrix3();
|
|
|
+
|
|
|
+class Plane {
|
|
|
+
|
|
|
+ constructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {
|
|
|
+
|
|
|
+ // normal is assumed to be normalized
|
|
|
+
|
|
|
+ this.normal = normal;
|
|
|
+ this.constant = constant;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ set( normal, constant ) {
|
|
|
+
|
|
|
+ this.normal.copy( normal );
|
|
|
+ this.constant = constant;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ setComponents( x, y, z, w ) {
|
|
|
+
|
|
|
+ this.normal.set( x, y, z );
|
|
|
+ this.constant = w;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ setFromNormalAndCoplanarPoint( normal, point ) {
|
|
|
+
|
|
|
+ this.normal.copy( normal );
|
|
|
+ this.constant = - point.dot( this.normal );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ setFromCoplanarPoints( a, b, c ) {
|
|
|
+
|
|
|
+ const normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();
|
|
|
+
|
|
|
+ // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?
|
|
|
+
|
|
|
+ this.setFromNormalAndCoplanarPoint( normal, a );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ copy( plane ) {
|
|
|
+
|
|
|
+ this.normal.copy( plane.normal );
|
|
|
+ this.constant = plane.constant;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ normalize() {
|
|
|
+
|
|
|
+ // Note: will lead to a divide by zero if the plane is invalid.
|
|
|
+
|
|
|
+ const inverseNormalLength = 1.0 / this.normal.length();
|
|
|
+ this.normal.multiplyScalar( inverseNormalLength );
|
|
|
+ this.constant *= inverseNormalLength;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ negate() {
|
|
|
+
|
|
|
+ this.constant *= - 1;
|
|
|
+ this.normal.negate();
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ distanceToPoint( point ) {
|
|
|
+
|
|
|
+ return this.normal.dot( point ) + this.constant;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ distanceToSphere( sphere ) {
|
|
|
+
|
|
|
+ return this.distanceToPoint( sphere.center ) - sphere.radius;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ projectPoint( point, target ) {
|
|
|
+
|
|
|
+ return target.copy( this.normal ).multiplyScalar( - this.distanceToPoint( point ) ).add( point );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ intersectLine( line, target ) {
|
|
|
+
|
|
|
+ const direction = line.delta( _vector1 );
|
|
|
+
|
|
|
+ const denominator = this.normal.dot( direction );
|
|
|
+
|
|
|
+ if ( denominator === 0 ) {
|
|
|
+
|
|
|
+ // line is coplanar, return origin
|
|
|
+ if ( this.distanceToPoint( line.start ) === 0 ) {
|
|
|
+
|
|
|
+ return target.copy( line.start );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // Unsure if this is the correct method to handle this case.
|
|
|
+ return null;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ const t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;
|
|
|
+
|
|
|
+ if ( t < 0 || t > 1 ) {
|
|
|
+
|
|
|
+ return null;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return target.copy( direction ).multiplyScalar( t ).add( line.start );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ intersectsLine( line ) {
|
|
|
+
|
|
|
+ // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.
|
|
|
+
|
|
|
+ const startSign = this.distanceToPoint( line.start );
|
|
|
+ const endSign = this.distanceToPoint( line.end );
|
|
|
+
|
|
|
+ return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ intersectsBox( box ) {
|
|
|
+
|
|
|
+ return box.intersectsPlane( this );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ intersectsSphere( sphere ) {
|
|
|
+
|
|
|
+ return sphere.intersectsPlane( this );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ coplanarPoint( target ) {
|
|
|
+
|
|
|
+ return target.copy( this.normal ).multiplyScalar( - this.constant );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ applyMatrix4( matrix, optionalNormalMatrix ) {
|
|
|
+
|
|
|
+ const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );
|
|
|
+
|
|
|
+ const referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );
|
|
|
+
|
|
|
+ const normal = this.normal.applyMatrix3( normalMatrix ).normalize();
|
|
|
+
|
|
|
+ this.constant = - referencePoint.dot( normal );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ translate( offset ) {
|
|
|
+
|
|
|
+ this.constant -= offset.dot( this.normal );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ equals( plane ) {
|
|
|
+
|
|
|
+ return plane.normal.equals( this.normal ) && ( plane.constant === this.constant );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ clone() {
|
|
|
+
|
|
|
+ return new this.constructor().copy( this );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+Plane.prototype.isPlane = true;
|
|
|
+
|
|
|
const _sphere$2 = /*@__PURE__*/ new Sphere();
|
|
|
const _vector$7 = /*@__PURE__*/ new Vector3();
|
|
|
|
|
@@ -23835,14 +23674,6 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
this.getSize = function ( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'WebGLRenderer: .getsize() now requires a Vector2 as an argument' );
|
|
|
-
|
|
|
- target = new Vector2();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.set( _width, _height );
|
|
|
|
|
|
};
|
|
@@ -23875,14 +23706,6 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
this.getDrawingBufferSize = function ( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument' );
|
|
|
-
|
|
|
- target = new Vector2();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.set( _width * _pixelRatio, _height * _pixelRatio ).floor();
|
|
|
|
|
|
};
|
|
@@ -23903,14 +23726,6 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
this.getCurrentViewport = function ( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument' );
|
|
|
-
|
|
|
- target = new Vector4();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.copy( _currentViewport );
|
|
|
|
|
|
};
|
|
@@ -23987,14 +23802,6 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
this.getClearColor = function ( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'WebGLRenderer: .getClearColor() now requires a Color as an argument' );
|
|
|
-
|
|
|
- target = new Color();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.copy( background.getClearColor() );
|
|
|
|
|
|
};
|
|
@@ -45251,26 +45058,12 @@ class Box2 {
|
|
|
|
|
|
getCenter( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Box2: .getCenter() target is now required' );
|
|
|
- target = new Vector2();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );
|
|
|
|
|
|
}
|
|
|
|
|
|
getSize( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Box2: .getSize() target is now required' );
|
|
|
- target = new Vector2();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min );
|
|
|
|
|
|
}
|
|
@@ -45321,13 +45114,6 @@ class Box2 {
|
|
|
// This can potentially have a divide by zero if the box
|
|
|
// has a size dimension of 0.
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Box2: .getParameter() target is now required' );
|
|
|
- target = new Vector2();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.set(
|
|
|
( point.x - this.min.x ) / ( this.max.x - this.min.x ),
|
|
|
( point.y - this.min.y ) / ( this.max.y - this.min.y )
|
|
@@ -45346,13 +45132,6 @@ class Box2 {
|
|
|
|
|
|
clampPoint( point, target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Box2: .clampPoint() target is now required' );
|
|
|
- target = new Vector2();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.copy( point ).clamp( this.min, this.max );
|
|
|
|
|
|
}
|
|
@@ -45433,26 +45212,12 @@ class Line3 {
|
|
|
|
|
|
getCenter( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Line3: .getCenter() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.addVectors( this.start, this.end ).multiplyScalar( 0.5 );
|
|
|
|
|
|
}
|
|
|
|
|
|
delta( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Line3: .delta() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return target.subVectors( this.end, this.start );
|
|
|
|
|
|
}
|
|
@@ -45471,13 +45236,6 @@ class Line3 {
|
|
|
|
|
|
at( t, target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Line3: .at() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return this.delta( target ).multiplyScalar( t ).add( this.start );
|
|
|
|
|
|
}
|
|
@@ -45506,13 +45264,6 @@ class Line3 {
|
|
|
|
|
|
const t = this.closestPointToPointParameter( point, clampToLine );
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Line3: .closestPointToPoint() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
return this.delta( target ).multiplyScalar( t ).add( this.start );
|
|
|
|
|
|
}
|