|
@@ -2136,6 +2136,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ toJSON() {
|
|
|
|
+
|
|
|
|
+ return this.toArray();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
_onChange( callback ) {
|
|
_onChange( callback ) {
|
|
|
|
|
|
this._onChangeCallback = callback;
|
|
this._onChangeCallback = callback;
|
|
@@ -2793,6 +2799,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ setFromColor( c ) {
|
|
|
|
+
|
|
|
|
+ this.x = c.r;
|
|
|
|
+ this.y = c.g;
|
|
|
|
+ this.z = c.b;
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
equals( v ) {
|
|
equals( v ) {
|
|
|
|
|
|
return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );
|
|
return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );
|
|
@@ -7898,6 +7914,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
const _vbp = /*@__PURE__*/ new Vector3();
|
|
const _vbp = /*@__PURE__*/ new Vector3();
|
|
const _vcp = /*@__PURE__*/ new Vector3();
|
|
const _vcp = /*@__PURE__*/ new Vector3();
|
|
|
|
|
|
|
|
+ let warnedGetUV = false;
|
|
|
|
+
|
|
class Triangle {
|
|
class Triangle {
|
|
|
|
|
|
constructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {
|
|
constructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {
|
|
@@ -7969,7 +7987,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
static getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) {
|
|
static getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) {
|
|
|
|
|
|
- console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' );
|
|
|
|
|
|
+ if ( warnedGetUV === false ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' ); // @deprecated since r151
|
|
|
|
+
|
|
|
|
+ warnedGetUV = true;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
return this.getInterpolation( point, p1, p2, p3, uv1, uv2, uv3, target );
|
|
return this.getInterpolation( point, p1, p2, p3, uv1, uv2, uv3, target );
|
|
|
|
|
|
@@ -8079,7 +8103,13 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
getUV( point, uv1, uv2, uv3, target ) {
|
|
getUV( point, uv1, uv2, uv3, target ) {
|
|
|
|
|
|
- console.warn( 'Triangle.getUV() has been renamed to Triangle.getInterpolation().' );
|
|
|
|
|
|
+ if ( warnedGetUV === false ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' ); // @deprecated since r151
|
|
|
|
+
|
|
|
|
+ warnedGetUV = true;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
return Triangle.getInterpolation( point, this.a, this.b, this.c, uv1, uv2, uv3, target );
|
|
return Triangle.getInterpolation( point, this.a, this.b, this.c, uv1, uv2, uv3, target );
|
|
|
|
|
|
@@ -8929,24 +8959,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
if ( size === 3 ) {
|
|
if ( size === 3 ) {
|
|
|
|
|
|
// #ff0
|
|
// #ff0
|
|
- this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255;
|
|
|
|
- this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255;
|
|
|
|
- this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255;
|
|
|
|
-
|
|
|
|
- ColorManagement.toWorkingColorSpace( this, colorSpace );
|
|
|
|
-
|
|
|
|
- return this;
|
|
|
|
|
|
+ return this.setRGB(
|
|
|
|
+ parseInt( hex.charAt( 0 ), 16 ) / 15,
|
|
|
|
+ parseInt( hex.charAt( 1 ), 16 ) / 15,
|
|
|
|
+ parseInt( hex.charAt( 2 ), 16 ) / 15,
|
|
|
|
+ colorSpace
|
|
|
|
+ );
|
|
|
|
|
|
} else if ( size === 6 ) {
|
|
} else if ( size === 6 ) {
|
|
|
|
|
|
// #ff0000
|
|
// #ff0000
|
|
- this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255;
|
|
|
|
- this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255;
|
|
|
|
- this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255;
|
|
|
|
-
|
|
|
|
- ColorManagement.toWorkingColorSpace( this, colorSpace );
|
|
|
|
-
|
|
|
|
- return this;
|
|
|
|
|
|
+ return this.setHex( parseInt( hex, 16 ), colorSpace );
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
@@ -9232,6 +9255,29 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ setFromVector3( v ) {
|
|
|
|
+
|
|
|
|
+ this.r = v.x;
|
|
|
|
+ this.g = v.y;
|
|
|
|
+ this.b = v.z;
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ applyMatrix3( m ) {
|
|
|
|
+
|
|
|
|
+ const r = this.r, g = this.g, b = this.b;
|
|
|
|
+ const e = m.elements;
|
|
|
|
+
|
|
|
|
+ this.r = e[ 0 ] * r + e[ 3 ] * g + e[ 6 ] * b;
|
|
|
|
+ this.g = e[ 1 ] * r + e[ 4 ] * g + e[ 7 ] * b;
|
|
|
|
+ this.b = e[ 2 ] * r + e[ 5 ] * g + e[ 8 ] * b;
|
|
|
|
+
|
|
|
|
+ return this;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
equals( c ) {
|
|
equals( c ) {
|
|
|
|
|
|
return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );
|
|
return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );
|