intersectsBoundingSphere method

bool intersectsBoundingSphere(
  1. BoundingSphere sphere
)

Returns true if the given bounding sphere intersects this OBB.

Implementation

bool intersectsBoundingSphere(BoundingSphere sphere ) {
	// find the point on the OBB closest to the sphere center
	clampPoint( sphere.center, _closestPoint );
	// if that point is inside the sphere, the OBB and sphere intersect
	return _closestPoint.squaredDistanceTo( sphere.center ) <= ( sphere.radius * sphere.radius );
}