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 Vector3 dist = Vector3.zero();//bscDist;
  bodyA.position.sub2(bodyB.position, dist);
  final sa = bodyA.shapes[0];
  final sb = bodyB.shapes[0];
  return math.pow(sa.boundingSphereRadius + sb.boundingSphereRadius, 2) > dist.length2;
}