Obstacle between two points
Hello Please help me how to find no of obstacles between two points. I was creation a building and i want to know the no f walls present between character and an actor. plzzz help..........
asked Jan 04 '16 at 11:04 AM in C++ Programming
You will have to perform line traces to check if there is something between point A and point B. The trace will stop at the first obstacle so you may want to perform another trace from that obstacle onward to point B again. There might be always some cases where traces are not the most adequate solution so it depends on your implementation and of course your use case and requirements.
Trace from A to B with obstacles in the middle, going from A to B we will find O1 and O2 in the path. So what we do is to do another trace from each hit to B again. It's important to temporally disable the trace response of the hit (O1 and O2) because if not you will get that hit again (you can also ignore the actors by checking the ignore self box if the consequent traces use the hit as the trace actor). So you will end up with something like:
I would suggest you to start playing around with line traces and multi line traces to see if it's enough for you or not. Check out this wiki post about traces. Another type of traces that may fit your problem better would be a box shape trace.
Follow this question
Once you sign in you will be able to subscribe for any updates here