I am using a client-side stationary hitbox (don’t worry, sanity checks are there) that uses attatchments, with one in each corner. Raycasts are fired from each attatchment to every other one and will tell the server if anything intersects. I need this specifically since: raycasts are cheap, results can be quick, and they don’t need to be moving.
The issue with this system is that there will be useless “double checks”. Since each attatchment fires at every other one, the loop will eventually repeat a pair of attatchments. For example:
There are three points: 1, 2, and 3.
Point 1 fires to point 2, then to point 3.
Point 2 now fires to 3, but fires to point 1 which is reduntant.
Is there a way to list pairs, detect them, and prevent them from firing to save resources?
This will only detect if something is both intersecting an edge, and is not completely enclosing the origin the ray was cast from. That is very specific, and not a check for collision in general. What is your specific use case?
It’s for melee strikes, like swinging a knife or sword. The targets aren’t gargantuan or anything, and if I need something really large/small I could use magnitude.