studio-blender icon indicating copy to clipboard operation
studio-blender copied to clipboard

check both positive and negative axis's for inside mesh

Open Happyrobot33 opened this issue 1 month ago • 4 comments

This fixes an issue I encountered where drones nearby a object that was set with a LED effect as inside mesh would be lit up depending on their orientation to the object. This is because the raycast check that was performed is only done for the 3 positive axis's, not the negative. Editing this array to include both positive and negative axis's makes this check significantly more consistent

Happyrobot33 avatar Oct 20 '25 19:10 Happyrobot33

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 20 '25 19:10 CLAassistant

Thanks! I'm a bit worried about the performance implications -- this means that we need to cast twice as many rays to check for containment thatn before. Just to understand the context: were you getting false positives (i.e. drones lighting up when they were outside the mesh) or false negatives (drones not lighting up when they were inside the mesh)? Was the mesh concave or convex? If you have some time, please show an example screenshot (not necessary to proceed, just curious).

ntamas avatar Oct 20 '25 20:10 ntamas

false positives in this case, a tight formation in a circle image

Without the fix image

With the fix image

Happyrobot33 avatar Oct 20 '25 21:10 Happyrobot33

one different way to do this I presume is to start the ray at the positive axis offset, and end it at the negative axis offset. half as many rays, they just go twice as far as before

Happyrobot33 avatar Oct 20 '25 21:10 Happyrobot33