boundingSphereCheck method

bool boundingSphereCheck(
  1. Body bodyA,
  2. Body bodyB
)

Check if the bounding spheres of two bodies overlap.

Implementation

bool boundingSphereCheck(Body bodyA, Body bodyB) {
  final Vec3 dist = Vec3();//bscDist;
  bodyA.position.vsub(bodyB.position, dist);
  final sa = bodyA.shapes[0];
  final sb = bodyB.shapes[0];
  return math.pow(sa.boundingSphereRadius + sb.boundingSphereRadius, 2) > dist.lengthSquared();
}