- Home /
Calculating safe zones
Hello, I am doing custom collision avoidance code. The idea is to find safe zones within vision cone which is created with ray-casts. And the main problem I have is generating possible paths. I need to generate two data collections and compare them (and select result from their union):
first one is angle collection within vision cone, of angles at which I could bypass static objects;
second collection is more complicated. I have calculated territories where could be moving obstacle at different time frames approximately and I need angle-position (point in space) collection;
It is kind of abstract question, but I hope maybe someone would have any suggestion how i could retrieve/create such data, I added picture showing principle for passing dynamic objects. If there is missing details ask in comments and I will update my question according.
So, you want to calculate possible collision paths so your objects can avoid colliding with each other? Could you care to elaborate a bit more?
Yes, as I said I need two collections which would contain degrees at which would be possible to go to pass the static and dynamic objects. For static ones I need to know degrees at which I could go without hitting nearest static object. For dynamic objects I calculate where they will be at specific time moments (so I have predictions of possible ways), after that I am calculating speeds which I need to pass or let the obstacle through (for every degree in possible way collection).
I never did this before so here goes nothing. :)
I'd assume we would need the following information.
Entity A - The reference entity that the player controls. It could be stopping or moving.
We need the following in respect to Entity A.
Direction of velocity of Entity A.
$$anonymous$$agnitude of velocity of Entity A.
Width and direction of collision avoidance cone of Entity A.
Some sort of raycasting or collision detection within this cone.
Then we have the Entity B - which is either static or dynamic candidates for collision.
We need the following in respect to Entity B.
Direction of velocity of Entity B.
$$anonymous$$agnitude of velocity of Entity B.
Some sort of raycasting to detect Entity A's collision detection cone. This way you can see if Entity A and Entity B cross roads before they collide and report a possible collision.
PS: For static items, you don't need anything really. Entity A's collision scan activity should include or exclude via a range or size variable depending on Entity A's own direction and velocity.
Your answer
Follow this Question
Related Questions
need some help with basic pathfinding with obstacle avoidance 0 Answers
Attacking units surround attacked building properly? (New solution, or fix to Nav Mesh?) 0 Answers
Deterministic Pathfinding 1 Answer
How do i get the IsPathPossible() function to ignore some nodes using Astar Pathfinding Project 0 Answers