Browse Source

BufferGeometryUtils: Return BufferGeometry if it is already the type.

Mr.doob 12 năm trước cách đây
mục cha
commit
dfffcb5f5e
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      examples/js/BufferGeometryUtils.js

+ 6 - 0
examples/js/BufferGeometryUtils.js

@@ -7,6 +7,12 @@ THREE.BufferGeometryUtils = {
 
 	fromGeometry: function geometryToBufferGeometry( geometry, settings ) {
 
+		if ( geometry instanceof THREE.BufferGeometry ) {
+
+			return geometry;
+
+		}
+
 		settings = settings || { 'vertexColors': THREE.NoColors };
 
 		var vertices = geometry.vertices;