Realize the function of passively detecting the presence or absence of each material level
Passive detection: Manually specify the material level in the attribute and return information about whether the material level has material or no material.
In the picture, the electrode material rack has a total of 112 material levels. At present, a coordinate frame, a Boolean signal, and a ray sensor are added to each material level to implement the function of passively detecting whether there is material or not in each material level.Because I don’t want the scanning frequency of the ray sensors to be less than 0.1 seconds, these ray sensors take up a lot of running memory in the background scanning, resulting in the problem of running simulation slow.
I tried the following methods to solve the problem:
use a ray sensor plus 112 coordinate boxes (the default coordinate box has been defined on each material level), and bind the corresponding material level coordinate box of the ray sensor through the specified material level, so that the ray sensor can detect at different material levels, This is why I asked how to implement the array of coordinate boxes, but I have tested this method and the results are not ideal, Even if the material level I specified is material, it also feeds back information that is not material, The feedback is correct only when I specify this bit for the second time (after the first designation, the coordinate box is stuck in the current position before the simulation is run without a reset), This may be because the ray sensor updates the bound coordinate box slowly. I try to add a delay under the update ray sensor coordinate box statement that defines the function to wait for the ray sensor update to complete before outputting the test results, But adding a delay to the function has no effect. No matter how long I add the delay, it always outputs the result immediately.
Use a ray sensor and a coordinate box, and offset the coordinate box to the specified material level, so that the ray sensor can detect at different material levels, 2) This is why I asked how to achieve the offset of the coordinate box, but the result is the same as test 1).
Use a ray sensor to add a coordinate box, but instead of shifting the coordinate box to the specified bit, add the coordinate box to a new joint, By offsetting the joint to the specified material level and indirectly offsetting the coordinate frame to achieve the detection of the ray sensor at different material levels to verify the “TSy” method, the result is still the same as test 1).