Browse Source

BufferGeometry: Trying to prettify...

Mr.doob 11 years ago
parent
commit
bbac1768e0
1 changed files with 12 additions and 7 deletions
  1. 12 7
      src/core/BufferGeometry.js

+ 12 - 7
src/core/BufferGeometry.js

@@ -9,16 +9,9 @@ THREE.BufferGeometry = function () {
 
 
 	this.name = '';
 	this.name = '';
 
 
-	// attributes
-
 	this.attributes = {};
 	this.attributes = {};
-
-	// offsets for chunks when using indexed elements
-
 	this.offsets = [];
 	this.offsets = [];
 
 
-	// boundings
-
 	this.boundingBox = null;
 	this.boundingBox = null;
 	this.boundingSphere = null;
 	this.boundingSphere = null;
 
 
@@ -60,6 +53,18 @@ THREE.BufferGeometry.prototype = {
 
 
 	},
 	},
 
 
+	addDrawCall: function ( start, count, indexOffset ) {
+
+		this.offsets.push( {
+
+			start: start,
+			count: count,
+			index: indexOffset || 0
+
+		} );
+
+	},
+
 	applyMatrix: function ( matrix ) {
 	applyMatrix: function ( matrix ) {
 
 
 		var position = this.attributes.position;
 		var position = this.attributes.position;