/** * @author mr.doob / http://mrdoob.com/ */ THREE.Mesh = function ( geometry, material, normUVs ) { THREE.Object3D.call( this ); this.geometry = geometry; this.material = material instanceof Array ? material : [ material ]; this.flipSided = false; this.doubleSided = false; this.overdraw = false; this.materialFaceGroup = {}; this.sortFacesByMaterial(); if( normUVs ) this.normalizeUVs(); this.geometry.computeBoundingBox(); }; THREE.Mesh.prototype = new THREE.Object3D(); THREE.Mesh.prototype.constructor = THREE.Mesh; THREE.Mesh.prototype.sortFacesByMaterial = function () { // TODO // Should optimize by grouping faces with ColorFill / ColorStroke materials // which could then use vertex color attributes instead of each being // in its separate VBO function materialHash( material ) { var i, l, hash_array = []; for ( i = 0, l = material.length; i