Sign in to follow this  
digitspro

[NOT-A-BUG] disabling meshes causes intersectsMesh to always return true

Recommended Posts

Hi,

Why is it that when I have a mesh disabled (i.e. mesh.setEnabled(false)) any intersectsMesh by it or against it returns true? Setting the method's second parameter 'precise' to true does not help.

This output seems counter intuitive and I do not believe it is what anyone would expect. In fact, my intuitive expectation is that by having the mesh disabled, any intersectsMesh on it or against it should return false (even if the mesh being tested with it is in the same position that it would appear in if enabled).

What do you think?

 

Playground showing the problem (watch out for the browser console which prints the result of the intersectsMesh method testing two exclusive spheres in position which one of them is disabled): http://www.babylonjs-playground.com/#PD7PP#0

Share this post


Link to post
Share on other sites
4 hours ago, Deltakosh said:

 

Hi!

intersectsMesh does not take in account any scene or visual parameters. It just checks if two meshes intersect.

 

Thanks for the reply. Fair enough, but even with this consideration, intersectsMesh is not behaving as expected;

In this case, I would not expect intersectsMesh result to be affected by changing setEnabled flag. If you notice this is what is happening now:

1) I have two meshes enabled. No overlapping. intersectsMesh gives false.

2) I disable one of them. Nothing else is different. Position etc are same.

3) intersectsMesh suddenly gives true.

I can do checking on my end to avoid this undesired behaviour of course, but I prefer to bring it up if it is really a bug as I thought. It is surely strange to me. Following what you said, one would not expect its output to change at least in this scenario.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.