Implement more complex area modifications (#260)

This implements rcAreaModification which allows combining of area types when they overlap
and otherwise usage of the area type as a bit mask.
This commit is contained in:
Domenico Albani
2017-03-12 12:18:29 +01:00
committed by Jakob Botsch Nielsen
parent ef3ea40f7a
commit 433986a5a4
15 changed files with 200 additions and 134 deletions
+6 -6
View File
@@ -257,12 +257,12 @@ void NavMeshTesterTool::init(Sample* sample)
if (m_navQuery)
{
// Change costs.
m_filter.setAreaCost(SAMPLE_POLYAREA_GROUND, 1.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_WATER, 10.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_ROAD, 1.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_DOOR, 1.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_GRASS, 2.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_JUMP, 1.5f);
m_filter.setAreaCost(SAMPLE_POLYAREA_TYPE_GROUND, 1.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_TYPE_WATER, 10.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_TYPE_ROAD, 1.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_FLAG_DOOR, 1.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_TYPE_GRASS, 2.0f);
m_filter.setAreaCost(SAMPLE_POLYAREA_FLAG_JUMP, 1.5f);
}
m_neighbourhoodRadius = sample->getAgentRadius() * 20.0f;