computeNormal static method
Vector3
computeNormal(
- Vector3 va,
- Vector3 vb,
- Vector3 vc,
- Vector3 target,
Get face normal given 3 vertices
Implementation
static Vector3 computeNormal(final Vector3 va, final Vector3 vb, final Vector3 vc, final Vector3 target) {
final cb = Vector3.zero();
final ab = Vector3.zero();
vb.sub2(va, ab);
vc.sub2(vb, cb);
cb.cross2(ab, target);
if (!target.isZero()) {
target.normalize();
}
return target;
}