From 870e0e37e52ec644ad1e2e728b8b9b422b1a6dc4 Mon Sep 17 00:00:00 2001 From: Nick Samarin Date: Thu, 29 Jul 2010 14:06:48 +0000 Subject: - fixed bug in steering actuator: calculate 2d distance to target for seeking and fleeing - added possibility to add navmesh modifier manually in order to transform manually created mesh to navigation mesh (with navigation polygons data layer) - added possibility to use existed navigation mesh object for navmesh generation (so new object won't be created, but existed object will be updated) --- extern/recastnavigation/BlenderNavMesh/NavMeshConversion.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'extern/recastnavigation') diff --git a/extern/recastnavigation/BlenderNavMesh/NavMeshConversion.cpp b/extern/recastnavigation/BlenderNavMesh/NavMeshConversion.cpp index ed02a27cc43..ca11ed68c54 100644 --- a/extern/recastnavigation/BlenderNavMesh/NavMeshConversion.cpp +++ b/extern/recastnavigation/BlenderNavMesh/NavMeshConversion.cpp @@ -310,11 +310,18 @@ bool buildNavMeshData(const int nverts, const float* verts, { memcpy(dtris+3*2*i, tris+3*dtrisToTrisMap[i], sizeof(unsigned short)*3); } - //create new recast data corresponded to dtris + //create new recast data corresponded to dtris and renumber for continious indices + int prevPolyIdx=-1, curPolyIdx, newPolyIdx=0; dtrisToPolysMap = new int[ndtris]; for (int i=0; i