|
@@ -2870,43 +2870,28 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * Matrices for sRGB and Display P3, based on the W3C specifications
|
|
|
- * for sRGB and Display P3, and the ICC specification for the D50
|
|
|
- * connection space.
|
|
|
+ * Matrices converting P3 <-> Rec. 709 primaries, without gamut mapping
|
|
|
+ * or clipping. Based on W3C specifications for sRGB and Display P3,
|
|
|
+ * and ICC specifications for the D50 connection space. Values in/out
|
|
|
+ * are _linear_ sRGB and _linear_ Display P3.
|
|
|
+ *
|
|
|
+ * Note that both sRGB and Display P3 use the sRGB transfer functions.
|
|
|
*
|
|
|
* Reference:
|
|
|
* - http://www.russellcottrell.com/photo/matrixCalculator.htm
|
|
|
*/
|
|
|
|
|
|
- const SRGB_TO_DISPLAY_P3 = new Matrix3().multiplyMatrices(
|
|
|
- // XYZ to Display P3
|
|
|
- new Matrix3().set(
|
|
|
- 2.4039840, - 0.9899069, - 0.3976415,
|
|
|
- - 0.8422229, 1.7988437, 0.0160354,
|
|
|
- 0.0482059, - 0.0974068, 1.2740049,
|
|
|
- ),
|
|
|
- // sRGB to XYZ
|
|
|
- new Matrix3().set(
|
|
|
- 0.4360413, 0.3851129, 0.1430458,
|
|
|
- 0.2224845, 0.7169051, 0.0606104,
|
|
|
- 0.0139202, 0.0970672, 0.7139126,
|
|
|
- ),
|
|
|
- );
|
|
|
+ const LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = new Matrix3().fromArray( [
|
|
|
+ 0.8224621, 0.0331941, 0.0170827,
|
|
|
+ 0.1775380, 0.9668058, 0.0723974,
|
|
|
+ - 0.0000001, 0.0000001, 0.9105199
|
|
|
+ ] );
|
|
|
|
|
|
- const DISPLAY_P3_TO_SRGB = new Matrix3().multiplyMatrices(
|
|
|
- // XYZ to sRGB
|
|
|
- new Matrix3().set(
|
|
|
- 3.1341864, - 1.6172090, - 0.4906941,
|
|
|
- - 0.9787485, 1.9161301, 0.0334334,
|
|
|
- 0.0719639, - 0.2289939, 1.4057537,
|
|
|
- ),
|
|
|
- // Display P3 to XYZ
|
|
|
- new Matrix3().set(
|
|
|
- 0.5151187, 0.2919778, 0.1571035,
|
|
|
- 0.2411892, 0.6922441, 0.0665668,
|
|
|
- - 0.0010505, 0.0418791, 0.7840713,
|
|
|
- ),
|
|
|
- );
|
|
|
+ const LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = new Matrix3().fromArray( [
|
|
|
+ 1.2249401, - 0.0420569, - 0.0196376,
|
|
|
+ - 0.2249404, 1.0420571, - 0.0786361,
|
|
|
+ 0.0000001, 0.0000000, 1.0982735
|
|
|
+ ] );
|
|
|
|
|
|
const _vector$c = new Vector3();
|
|
|
|
|
@@ -2914,7 +2899,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
color.convertSRGBToLinear();
|
|
|
|
|
|
- _vector$c.set( color.r, color.g, color.b ).applyMatrix3( DISPLAY_P3_TO_SRGB );
|
|
|
+ _vector$c.set( color.r, color.g, color.b ).applyMatrix3( LINEAR_DISPLAY_P3_TO_LINEAR_SRGB );
|
|
|
|
|
|
return color.setRGB( _vector$c.x, _vector$c.y, _vector$c.z );
|
|
|
|
|
@@ -2922,7 +2907,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
function LinearSRGBToDisplayP3( color ) {
|
|
|
|
|
|
- _vector$c.set( color.r, color.g, color.b ).applyMatrix3( SRGB_TO_DISPLAY_P3 );
|
|
|
+ _vector$c.set( color.r, color.g, color.b ).applyMatrix3( LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 );
|
|
|
|
|
|
return color.setRGB( _vector$c.x, _vector$c.y, _vector$c.z ).convertLinearToSRGB();
|
|
|
|
|
@@ -3321,7 +3306,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
- set image( value ) {
|
|
|
+ set image( value = null ) {
|
|
|
|
|
|
this.source.data = value;
|
|
|
|
|
@@ -5471,8 +5456,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
// t1 = second intersect point - exit point on back of sphere
|
|
|
const t1 = tca + thc;
|
|
|
|
|
|
- // test to see if both t0 and t1 are behind the ray - if so, return null
|
|
|
- if ( t0 < 0 && t1 < 0 ) return null;
|
|
|
+ // test to see if t1 is behind the ray - if so, return null
|
|
|
+ if ( t1 < 0 ) return null;
|
|
|
|
|
|
// test to see if t0 is behind the ray:
|
|
|
// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,
|
|
@@ -10910,10 +10895,6 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
this.userData = source.userData;
|
|
|
|
|
|
- // geometry generator parameters
|
|
|
-
|
|
|
- if ( source.parameters !== undefined ) this.parameters = Object.assign( {}, source.parameters );
|
|
|
-
|
|
|
return this;
|
|
|
|
|
|
}
|
|
@@ -11471,6 +11452,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new BoxGeometry( data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments );
|
|
@@ -12988,6 +12979,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new PlaneGeometry( data.width, data.height, data.widthSegments, data.heightSegments );
|
|
@@ -33659,6 +33660,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new LatheGeometry( data.points, data.segments, data.phiStart, data.phiLength );
|
|
@@ -33772,6 +33783,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new CircleGeometry( data.radius, data.segments, data.thetaStart, data.thetaLength );
|
|
@@ -34041,6 +34062,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new CylinderGeometry( data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );
|
|
@@ -34372,6 +34403,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new PolyhedronGeometry( data.vertices, data.indices, data.radius, data.details );
|
|
@@ -34575,6 +34616,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
class Shape extends Path {
|
|
@@ -36222,6 +36273,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
toJSON() {
|
|
|
|
|
|
const data = super.toJSON();
|
|
@@ -36520,6 +36581,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new RingGeometry( data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength );
|
|
@@ -36654,6 +36725,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
toJSON() {
|
|
|
|
|
|
const data = super.toJSON();
|
|
@@ -36820,6 +36901,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength );
|
|
@@ -36956,6 +37047,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc );
|
|
@@ -37108,6 +37209,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
static fromJSON( data ) {
|
|
|
|
|
|
return new TorusKnotGeometry( data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q );
|
|
@@ -37275,6 +37386,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
toJSON() {
|
|
|
|
|
|
const data = super.toJSON();
|
|
@@ -37411,6 +37532,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.parameters = Object.assign( {}, source.parameters );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function isUniqueEdge( start, end, edges ) {
|