Bug with intersectsMesh

Hi everybody,

I think there is a bug in the intersectsMesh function.

Here’s a PG : https://playground.babylonjs.com/#C77SMH#93

I do not understand why the intersectsMesh function returns true in this case.

Can anybody help me ?

Thanks

Classic first-frame-world-matrix fun:

To avoid expensive computations, we assume the world matrix is correct, but you change the position and in the same frame check for intersection.

Thanks very much for the answer.

Would it be possible to add a boolean parameter in the intersectsMesh function to compute the 2 meshes before running the calculaion of the intersection ?

I don’t see a reason to do that. usually you wouldn’t encounter that. Render a single frame and you will see that it is false. this is just a first-frame issue (or better yet - a same-frame issue). if you check intersection in a onBeforeRender observer it will always calculate correctly.