|
@@ -1360,6 +1360,46 @@ class Matrix3 {
|
|
|
|
|
|
Matrix3.prototype.isMatrix3 = true;
|
|
|
|
|
|
+function arrayMax( array ) {
|
|
|
+
|
|
|
+ if ( array.length === 0 ) return - Infinity;
|
|
|
+
|
|
|
+ let max = array[ 0 ];
|
|
|
+
|
|
|
+ for ( let i = 1, l = array.length; i < l; ++ i ) {
|
|
|
+
|
|
|
+ if ( array[ i ] > max ) max = array[ i ];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return max;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const TYPED_ARRAYS = {
|
|
|
+ Int8Array: Int8Array,
|
|
|
+ Uint8Array: Uint8Array,
|
|
|
+ Uint8ClampedArray: Uint8ClampedArray,
|
|
|
+ Int16Array: Int16Array,
|
|
|
+ Uint16Array: Uint16Array,
|
|
|
+ Int32Array: Int32Array,
|
|
|
+ Uint32Array: Uint32Array,
|
|
|
+ Float32Array: Float32Array,
|
|
|
+ Float64Array: Float64Array
|
|
|
+};
|
|
|
+
|
|
|
+function getTypedArray( type, buffer ) {
|
|
|
+
|
|
|
+ return new TYPED_ARRAYS[ type ]( buffer );
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function createElementNS( name ) {
|
|
|
+
|
|
|
+ return document.createElementNS( 'http://www.w3.org/1999/xhtml', name );
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
let _canvas;
|
|
|
|
|
|
class ImageUtils {
|
|
@@ -1386,7 +1426,7 @@ class ImageUtils {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- if ( _canvas === undefined ) _canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
|
|
|
+ if ( _canvas === undefined ) _canvas = createElementNS( 'canvas' );
|
|
|
|
|
|
_canvas.width = image.width;
|
|
|
_canvas.height = image.height;
|
|
@@ -7521,6 +7561,16 @@ class Triangle {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ setFromAttributeAndIndices( attribute, i0, i1, i2 ) {
|
|
|
+
|
|
|
+ this.a.fromBufferAttribute( attribute, i0 );
|
|
|
+ this.b.fromBufferAttribute( attribute, i1 );
|
|
|
+ this.c.fromBufferAttribute( attribute, i2 );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
clone() {
|
|
|
|
|
|
return new this.constructor().copy( this );
|
|
@@ -9376,40 +9426,6 @@ class Float64BufferAttribute extends BufferAttribute {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function arrayMax( array ) {
|
|
|
-
|
|
|
- if ( array.length === 0 ) return - Infinity;
|
|
|
-
|
|
|
- let max = array[ 0 ];
|
|
|
-
|
|
|
- for ( let i = 1, l = array.length; i < l; ++ i ) {
|
|
|
-
|
|
|
- if ( array[ i ] > max ) max = array[ i ];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return max;
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-const TYPED_ARRAYS = {
|
|
|
- Int8Array: Int8Array,
|
|
|
- Uint8Array: Uint8Array,
|
|
|
- Uint8ClampedArray: Uint8ClampedArray,
|
|
|
- Int16Array: Int16Array,
|
|
|
- Uint16Array: Uint16Array,
|
|
|
- Int32Array: Int32Array,
|
|
|
- Uint32Array: Uint32Array,
|
|
|
- Float32Array: Float32Array,
|
|
|
- Float64Array: Float64Array
|
|
|
-};
|
|
|
-
|
|
|
-function getTypedArray( type, buffer ) {
|
|
|
-
|
|
|
- return new TYPED_ARRAYS[ type ]( buffer );
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
let _id = 0;
|
|
|
|
|
|
const _m1 = /*@__PURE__*/ new Matrix4();
|
|
@@ -21544,8 +21560,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
// Use OffscreenCanvas when available. Specially needed in web workers
|
|
|
|
|
|
return useOffscreenCanvas ?
|
|
|
- new OffscreenCanvas( width, height ) :
|
|
|
- document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
|
|
|
+ new OffscreenCanvas( width, height ) : createElementNS( 'canvas' );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -24908,7 +24923,7 @@ function WebGLMaterials( properties ) {
|
|
|
|
|
|
function createCanvasElement() {
|
|
|
|
|
|
- const canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
|
|
|
+ const canvas = createElementNS( 'canvas' );
|
|
|
canvas.style.display = 'block';
|
|
|
return canvas;
|
|
|
|
|
@@ -38466,7 +38481,7 @@ class ImageLoader extends Loader {
|
|
|
|
|
|
}
|
|
|
|
|
|
- const image = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'img' );
|
|
|
+ const image = createElementNS( 'img' );
|
|
|
|
|
|
function onImageLoad() {
|
|
|
|