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
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
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}
Some links to some ideas on collisions with spheres Babylon.js Documentation
Hey guys, take a look at this method.
Instead of using intersectMesh, use intersectsSphere, then the boundingSphere
https://www.babylonjs-playground.com/#NYWMTI#4
I think it works rather well, what are your thoughts?