Forráskód Böngészése

BufferGeometryUtils: Return BufferGeometry if it is already the type.

Mr.doob 12 éve
szülő
commit
dfffcb5f5e
1 módosított fájl, 6 hozzáadás és 0 törlés
  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;