getAveragePointLocal method

Vec3 getAveragePointLocal([
  1. Vec3? target
])

Get an average of all the vertices position

Implementation

Vec3 getAveragePointLocal([Vec3? target]) {
  target ??= Vec3();
  final verts = vertices;
  for (int i = 0; i < verts.length; i++) {
    target.vadd(verts[i], target);
  }
  target.scale(1 / verts.length, target);
  return target;
}