getFaceNormal method

Vec3 getFaceNormal(
  1. int i,
  2. Vec3 target
)

Compute the normal of a face from its vertices

Implementation

Vec3 getFaceNormal(int i, final Vec3 target) {
  final List<int> f = faces[i];
  final Vec3 va = vertices[f[0]];
  final Vec3 vb = vertices[f[1]];
  final Vec3 vc = vertices[f[2]];
  return ConvexPolyhedron.computeNormal(va, vb, vc, target);
}