-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Fix navmesh rebuild after mesh replacement. (#778)
Previously the navmesh rebuilding was failing because of two issues, first the mesh used as source was always the one from the blender object secondly the navmesh itself wasn't updated in the obstacle simulation. To solve this first issue the function BuildVertIndArrays is calling two sub functions, BuildFromDerivedMesh for creating from a derived mesh and benefit from CD_RECAST layer, if this function fails to get the recast layer BuildFromMesh is called and generate information from a RAS_Mesh without detailed meshes. In this last function the indices computation is solved by the requirement of Detour library to use 6 indices per polygon, the unused indices are discarded by value 0xFFFF. The second issue is solved by calling AddObstaclesForNavMesh only from KX_NavMeshObject::BuildNavMesh, this call is preceded by a call to DestroyObstacleForObj intenting to remove the previous obstacle associated to this navmesh. Fix issue #633.
- Loading branch information
1 parent
b9001b9
commit 5b8cb1e
Showing
3 changed files
with
183 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters