|
@@ -104,7 +104,7 @@ function computeMikkTSpaceTangents( geometry, MikkTSpace, negateSign = true ) {
|
|
* @param {Boolean} useGroups
|
|
* @param {Boolean} useGroups
|
|
* @return {BufferGeometry}
|
|
* @return {BufferGeometry}
|
|
*/
|
|
*/
|
|
-function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
+function mergeGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
const isIndexed = geometries[ 0 ].index !== null;
|
|
const isIndexed = geometries[ 0 ].index !== null;
|
|
|
|
|
|
@@ -129,7 +129,7 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
if ( isIndexed !== ( geometry.index !== null ) ) {
|
|
if ( isIndexed !== ( geometry.index !== null ) ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -140,7 +140,7 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
if ( ! attributesUsed.has( name ) ) {
|
|
if ( ! attributesUsed.has( name ) ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure "' + name + '" attribute exists among all geometries, or in none of them.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure "' + name + '" attribute exists among all geometries, or in none of them.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -157,7 +157,7 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
if ( attributesCount !== attributesUsed.size ) {
|
|
if ( attributesCount !== attributesUsed.size ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. Make sure all geometries have the same number of attributes.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. Make sure all geometries have the same number of attributes.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -166,7 +166,7 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
if ( morphTargetsRelative !== geometry.morphTargetsRelative ) {
|
|
if ( morphTargetsRelative !== geometry.morphTargetsRelative ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. .morphTargetsRelative must be consistent throughout all geometries.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. .morphTargetsRelative must be consistent throughout all geometries.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -175,7 +175,7 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
if ( ! morphAttributesUsed.has( name ) ) {
|
|
if ( ! morphAttributesUsed.has( name ) ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. .morphAttributes must be consistent throughout all geometries.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. .morphAttributes must be consistent throughout all geometries.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -200,7 +200,7 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. The geometry must have either an index or a position attribute' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. The geometry must have either an index or a position attribute' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -242,11 +242,11 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
for ( const name in attributes ) {
|
|
for ( const name in attributes ) {
|
|
|
|
|
|
- const mergedAttribute = mergeBufferAttributes( attributes[ name ] );
|
|
|
|
|
|
+ const mergedAttribute = mergeAttributes( attributes[ name ] );
|
|
|
|
|
|
if ( ! mergedAttribute ) {
|
|
if ( ! mergedAttribute ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + name + ' attribute.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the ' + name + ' attribute.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -276,11 +276,11 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- const mergedMorphAttribute = mergeBufferAttributes( morphAttributesToMerge );
|
|
|
|
|
|
+ const mergedMorphAttribute = mergeAttributes( morphAttributesToMerge );
|
|
|
|
|
|
if ( ! mergedMorphAttribute ) {
|
|
if ( ! mergedMorphAttribute ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + name + ' morphAttribute.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the ' + name + ' morphAttribute.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -299,7 +299,7 @@ function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
* @param {Array<BufferAttribute>} attributes
|
|
* @param {Array<BufferAttribute>} attributes
|
|
* @return {BufferAttribute}
|
|
* @return {BufferAttribute}
|
|
*/
|
|
*/
|
|
-function mergeBufferAttributes( attributes ) {
|
|
|
|
|
|
+function mergeAttributes( attributes ) {
|
|
|
|
|
|
let TypedArray;
|
|
let TypedArray;
|
|
let itemSize;
|
|
let itemSize;
|
|
@@ -312,7 +312,7 @@ function mergeBufferAttributes( attributes ) {
|
|
|
|
|
|
if ( attribute.isInterleavedBufferAttribute ) {
|
|
if ( attribute.isInterleavedBufferAttribute ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeAttributes() failed. InterleavedBufferAttributes are not supported.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -320,7 +320,7 @@ function mergeBufferAttributes( attributes ) {
|
|
if ( TypedArray === undefined ) TypedArray = attribute.array.constructor;
|
|
if ( TypedArray === undefined ) TypedArray = attribute.array.constructor;
|
|
if ( TypedArray !== attribute.array.constructor ) {
|
|
if ( TypedArray !== attribute.array.constructor ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -328,7 +328,7 @@ function mergeBufferAttributes( attributes ) {
|
|
if ( itemSize === undefined ) itemSize = attribute.itemSize;
|
|
if ( itemSize === undefined ) itemSize = attribute.itemSize;
|
|
if ( itemSize !== attribute.itemSize ) {
|
|
if ( itemSize !== attribute.itemSize ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -336,7 +336,7 @@ function mergeBufferAttributes( attributes ) {
|
|
if ( normalized === undefined ) normalized = attribute.normalized;
|
|
if ( normalized === undefined ) normalized = attribute.normalized;
|
|
if ( normalized !== attribute.normalized ) {
|
|
if ( normalized !== attribute.normalized ) {
|
|
|
|
|
|
- console.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.' );
|
|
|
|
|
|
+ console.error( 'THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.' );
|
|
return null;
|
|
return null;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1318,9 +1318,25 @@ function toCreasedNormals( geometry, creaseAngle = Math.PI / 3 /* 60 degrees */
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function mergeBufferGeometries( geometries, useGroups = false ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.BufferGeometryUtils: mergeBufferGeometries() has been renamed to mergeGeometries().' ); // @deprecated, r151
|
|
|
|
+ return mergeGeometries( geometries, useGroups );
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function mergeBufferAttributes( attributes ) {
|
|
|
|
+
|
|
|
|
+ console.warn( 'THREE.BufferGeometryUtils: mergeBufferAttributes() has been renamed to mergeAttributes().' ); // @deprecated, r151
|
|
|
|
+ return mergeAttributes( attributes );
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
export {
|
|
export {
|
|
computeMikkTSpaceTangents,
|
|
computeMikkTSpaceTangents,
|
|
|
|
+ mergeGeometries,
|
|
mergeBufferGeometries,
|
|
mergeBufferGeometries,
|
|
|
|
+ mergeAttributes,
|
|
mergeBufferAttributes,
|
|
mergeBufferAttributes,
|
|
interleaveAttributes,
|
|
interleaveAttributes,
|
|
estimateBytesUsed,
|
|
estimateBytesUsed,
|