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