|
@@ -1,31 +1,31 @@
|
|
|
import { Color } from '../math/Color.js';
|
|
|
import { Vector3 } from '../math/Vector3.js';
|
|
|
|
|
|
-function Face3( a, b, c, normal, color, materialIndex ) {
|
|
|
+class Face3 {
|
|
|
|
|
|
- this.a = a;
|
|
|
- this.b = b;
|
|
|
- this.c = c;
|
|
|
+ constructor( a, b, c, normal, color, materialIndex ) {
|
|
|
|
|
|
- this.normal = ( normal && normal.isVector3 ) ? normal : new Vector3();
|
|
|
- this.vertexNormals = Array.isArray( normal ) ? normal : [];
|
|
|
+ this.a = a;
|
|
|
+ this.b = b;
|
|
|
+ this.c = c;
|
|
|
|
|
|
- this.color = ( color && color.isColor ) ? color : new Color();
|
|
|
- this.vertexColors = Array.isArray( color ) ? color : [];
|
|
|
+ this.normal = ( normal && normal.isVector3 ) ? normal : new Vector3();
|
|
|
+ this.vertexNormals = Array.isArray( normal ) ? normal : [];
|
|
|
|
|
|
- this.materialIndex = materialIndex !== undefined ? materialIndex : 0;
|
|
|
+ this.color = ( color && color.isColor ) ? color : new Color();
|
|
|
+ this.vertexColors = Array.isArray( color ) ? color : [];
|
|
|
|
|
|
-}
|
|
|
+ this.materialIndex = materialIndex !== undefined ? materialIndex : 0;
|
|
|
|
|
|
-Object.assign( Face3.prototype, {
|
|
|
+ }
|
|
|
|
|
|
- clone: function () {
|
|
|
+ clone() {
|
|
|
|
|
|
return new this.constructor().copy( this );
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- copy: function ( source ) {
|
|
|
+ copy( source ) {
|
|
|
|
|
|
this.a = source.a;
|
|
|
this.b = source.b;
|
|
@@ -52,7 +52,7 @@ Object.assign( Face3.prototype, {
|
|
|
|
|
|
}
|
|
|
|
|
|
-} );
|
|
|
+}
|
|
|
|
|
|
|
|
|
export { Face3 };
|