studio-blender
studio-blender copied to clipboard
check both positive and negative axis's for inside mesh
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
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).
false positives in this case, a tight formation in a circle
Without the fix
With the fix
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