Skip to content

Simple Sphere-Sphere intersection test #227

Discussion options

You must be logged in to vote

While using bepuphysics2 to do something like this is possible, it'll feel a bit like using an industrial excavator for casual gardening. It's meant to do much harder things in very large numbers, so the API isn't well suited to this kind of simplicity.

Instead, consider something like:

var radiusSum = sphereRadiusA + sphereRadiusB;
var squaredRadiusSum = radiusSum * radiusSum;
if (Vector3.DistanceSquared(spherePositionA, spherePositionB) < squaredRadiusSum) { ... }

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Constantin-Ushkov
Comment options

@RossNordby
Comment options

Answer selected by Constantin-Ushkov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants