Просмотр исходного кода

Geometries: Reuse `arrayNeedsUint32()` from core. (#30408)

Michael Herzog 11 месяцев назад
Родитель
Сommit
cb91f1a15e
1 измененных файлов с 1 добавлено и 22 удалено
  1. 1 22
      src/renderers/common/Geometries.js

+ 1 - 22
src/renderers/common/Geometries.js

@@ -1,30 +1,9 @@
 import DataMap from './DataMap.js';
 import { AttributeType } from './Constants.js';
+import { arrayNeedsUint32 } from '../../utils.js';
 
 import { Uint16BufferAttribute, Uint32BufferAttribute } from '../../core/BufferAttribute.js';
 
-/**
- * Returns `true` if the given array has values that require an Uint32 array type.
- *
- * @private
- * @function
- * @param {Array<Number>} array - The array to test.
- * @return {Boolean} Whether the given array has values that require an Uint32 array type or not.
- */
-function arrayNeedsUint32( array ) {
-
-	// assumes larger values usually on last
-
-	for ( let i = array.length - 1; i >= 0; -- i ) {
-
-		if ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565
-
-	}
-
-	return false;
-
-}
-
 /**
  * Returns the wireframe version for the given geometry.
  *

粤ICP备19079148号