Bounding Sphere

Hey everyone,

I was wondering if there is a way to make a collision sphere, using boundingSphere, and to use with intersects mesh?
something like this but not intersectpoint intersects mesh
Testing some ideas

pseudo code. (but this is for two spheres and does not have the sqrt which you need)

if(ObjectB.position.add(ObjectA.position)).length <= (ObjectA.radius + ObjectB.radius){collision}else{no-collision}

f(A,B) = sqrt{(A_x - B_x)^2 + (A_y - B_y)^2 + (A_z - B_z)^2} <= A_{radius} + B_{radius}

1 Like

Some links to some ideas on collisions with spheres Babylon.js Documentation

1 Like

Hey guys, take a look at this method.
Instead of using intersectMesh, use intersectsSphere, then the boundingSphere

I think it works rather well, what are your thoughts?

1 Like