Parcourir la source

Rename computeMorphedBufferGeometry to computeMorphedAttributes

SntsDev il y a 4 ans
Parent
commit
c0eaf945b4

+ 1 - 1
docs/examples/en/utils/BufferGeometryUtils.html

@@ -74,7 +74,7 @@
 
 		</p>
 
-		<h3>[method:Object computeMorphedBufferGeometry]( [param:Object3D object] )</h3>
+		<h3>[method:Object computeMorphedAttributes]( [param:Object3D object] )</h3>
 		<p>
 		object -- Instance of [page:Object3D Object3D].<br /><br />
 

+ 3 - 7
examples/js/utils/BufferGeometryUtils.js

@@ -626,23 +626,19 @@ THREE.BufferGeometryUtils = {
 	 * @param {Object3D} object
 	 * @return {Object} An Object with original position/normal attributes and morphed ones.
 	 */
-	computeMorphedBufferGeometry: function ( object ) {
+	computeMorphedAttributes: function ( object ) {
 
 		if ( ! object ) {
 
 			console.error( 'Please provide an object' );
 			return null;
 
-		}
-
-		if ( ! object.geometry ) {
+		} else if ( ! object.geometry ) {
 
 			console.error( 'Please provide an object with a geometry' );
 			return null;
 
-		}
-
-		if ( ! object.geometry.isBufferGeometry ) {
+		} else if ( ! object.geometry.isBufferGeometry ) {
 
 			console.error( 'Geometry is not a BufferGeometry' );
 			return null;

+ 1 - 1
examples/jsm/utils/BufferGeometryUtils.d.ts

@@ -7,5 +7,5 @@ export namespace BufferGeometryUtils {
 	export function estimateBytesUsed( geometry: BufferGeometry ): number;
 	export function mergeVertices( geometry: BufferGeometry, tolerance?: number ): BufferGeometry;
 	export function toTrianglesDrawMode( geometry: BufferGeometry, drawMode: TrianglesDrawModes ): BufferGeometry;
-	export function computeMorphedBufferGeometry( object: Object3D ): Object;
+	export function computeMorphedAttributes( object: Object3D ): Object;
 }

+ 6 - 10
examples/jsm/utils/BufferGeometryUtils.js

@@ -638,25 +638,21 @@ var BufferGeometryUtils = {
 	 * @param {Object3D} object
 	 * @return {Object} An Object with original position/normal attributes and morphed ones.
 	 */
-	computeMorphedBufferGeometry: function ( object ) {
+	computeMorphedAttributes: function ( object ) {
 
 		if ( ! object ) {
 
-			console.error( 'Please provide an object' );
+			console.warn( 'Please provide an object' );
 			return null;
 
-		}
-
-		if ( ! object.geometry ) {
+		} else if ( ! object.geometry ) {
 
-			console.error( 'Please provide an object with a geometry' );
+			console.warn( 'Please provide an object with a geometry' );
 			return null;
 
-		}
-
-		if ( ! object.geometry.isBufferGeometry ) {
+		} else if ( ! object.geometry.isBufferGeometry ) {
 
-			console.error( 'Geometry is not a BufferGeometry' );
+			console.warn( 'Geometry is not a BufferGeometry' );
 			return null;
 
 		}