Closed curds01 closed 8 years ago
The interface receives a pointer to a ProximityFilter
. Generally, the pointer is asked for its query point and that query point is used to look up the node corresponding to the point. This is why the wrong node (aka polygon) is used, because this point is determined in a top-down manner.
However, if we recognize the types of classes that are tracked by the NavMeshLocalizer
, we can see if the filter object is one of those objects. If it is, we can simply use that object to look up the correct node in the localizer. Currently, there is only one tracked class: BaseAgent
. That is enough for now. If we end up tracking other entities, they will have to be added to this test.
Solution Merged
When using a navigation mesh-based spatial query object, when there is a navigation mesh polygon over an agent, the obstacles selected for that agent are the covering polygon and not the polygon the agent is actually on.
In the attached example (images shown below), the agent is walking down a ramp and about to cross under an overhang. As soon as the agent center crosses into the projection of the upper polygon, its obstacles will come from that polygon and the agent will not be able reach its goal because the upper polygon has an obstacle between the agent and its goal.
The project for evaluating this can be found below.
Fig 1. Agent walking down a ramp, underneath an overhang.
Fig 2. Agent about to pass under the overhang.
nav_mesh_fail.txt nav_mesh_failB.txt nav_mesh_failS.txt nav_mesh_failV.txt simple_NM.txt