updateBoundingSphereRadius method

  1. @override
void updateBoundingSphereRadius()
override

Computes the bounding sphere radius. The result is stored in the property .boundingSphereRadius

Implementation

@override
void updateBoundingSphereRadius() {
  // Assume points are distributed with local (0,0,0) as center
  double max2 = 0;
  final verts = vertices;
  for (int i = 0; i != verts.length; i++) {
    final norm2 = verts[i].lengthSquared();
    if (norm2 > max2) {
      max2 = norm2;
    }
  }
  boundingSphereRadius = math.sqrt(max2);
}