addFace method
dynamic
addFace(
- dynamic a,
- dynamic b,
- dynamic c,
- dynamic ua,
- dynamic ub,
- dynamic uc,
- dynamic na,
- dynamic nb,
- dynamic nc,
Implementation
addFace(a, b, c, ua, ub, uc, na, nb, nc) {
var vLen = this.vertices.length;
var ia = this.parseVertexIndex(a, vLen);
var ib = this.parseVertexIndex(b, vLen);
var ic = this.parseVertexIndex(c, vLen);
this.addVertex(ia, ib, ic);
this.addColor(ia, ib, ic);
// normals
if (na != null && na != '') {
var nLen = this.normals.length;
ia = this.parseNormalIndex(na, nLen);
ib = this.parseNormalIndex(nb, nLen);
ic = this.parseNormalIndex(nc, nLen);
this.addNormal(ia, ib, ic);
} else {
this.addFaceNormal(ia, ib, ic);
}
// uvs
if (ua != null && ua != '') {
var uvLen = this.uvs.length;
ia = this.parseUVIndex(ua, uvLen);
ib = this.parseUVIndex(ub, uvLen);
ic = this.parseUVIndex(uc, uvLen);
this.addUV(ia, ib, ic);
this.object!.geometry["hasUVIndices"] = true;
} else {
// add placeholder values (for inconsistent face definitions)
this.addDefaultUV();
}
}