Browse Source

GLTFExporter: use shorter version of getPaddedBufferSize calc

Christopher Cook 7 years ago
parent
commit
69d2c7d5cb
1 changed files with 1 additions and 8 deletions
  1. 1 8
      examples/js/exporters/GLTFExporter.js

+ 1 - 8
examples/js/exporters/GLTFExporter.js

@@ -189,16 +189,9 @@ THREE.GLTFExporter.prototype = {
 		 *
 		 */
 		function getPaddedBufferSize( bufferSize ) {
-			
-			// adapted from https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/master/lib/getBufferPadded.js
-
-			var boundary = 4;
 
-			var remainder = bufferSize % boundary;
-			
-			var padding =  remainder === 0 ? 0 : boundary - remainder;
+			return Math.ceil( bufferSize / 4 ) * 4;
 
-			return bufferSize + padding;
 		}
 		
 		/**