| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /**
- * @author mr.doob / http://mrdoob.com/
- * @author alteredq / http://alteredqualia.com/
- */
- THREE.Face4 = function ( a, b, c, d, normal, color, materialIndex ) {
- this.a = a;
- this.b = b;
- this.c = c;
- this.d = d;
- this.normal = normal instanceof THREE.Vector3 ? normal : new THREE.Vector3();
- this.vertexNormals = normal instanceof Array ? normal : [ ];
- this.color = color instanceof THREE.Color ? color : new THREE.Color();
- this.vertexColors = color instanceof Array ? color : [];
- this.vertexTangents = [];
- this.materialIndex = materialIndex;
- this.centroid = new THREE.Vector3();
- };
- THREE.Face4.prototype = {
- constructor: THREE.Face4,
- clone: function () {
- var tmp = new THREE.Face4( this.a, this.b, this.c, this.d );
- tmp.normal.copy( this.normal );
- tmp.color.copy( this.color );
- tmp.centroid.copy( this.centroid );
- tmp.materialIndex = this.materialIndex;
- var i, il;
- for ( i = 0, il = this.vertexNormals.length; i < il; i ++ ) tmp.vertexNormals[ i ] = this.vertexNormals[ i ].clone();
- for ( i = 0, il = this.vertexColors.length; i < il; i ++ ) tmp.vertexColors[ i ] = this.vertexColors[ i ].clone();
- for ( i = 0, il = this.vertexTangents.length; i < il; i ++ ) tmp.vertexTangents[ i ] = this.vertexTangents[ i ].clone();
- return tmp;
- }
- };
|