New question for you regarding to navigation stuff : )
In Question on RecastJSCrowd's function agentGoto(), I described the scenario of dynamically adding obstacles for crowd. So every time when a new “building” is placed, I call
RecastJSPlugin.createMavMesh() to update navmesh. It works, but with a brief performance drop. I experimented a bit and found that
INavMeshParameters has a big impact on it, which make sense, smaller cell size, heavier the calculation.
Then after update the navmesh, I need to update the related
RecastJSCrowd object. I assume calling
RecastJSPlugin.createCrowd() every time after navmesh gets updated is not the way to go. According to API,
RecastJSCrowd.update() seems to update only agent position/velocity/acceleration, and I tried to use it but failed anyway.
So, here are my 2 questions:
- Is calling
RecastJSPlugin.createMavMesh()the proper way for updating navmesh? If it is, how to handle the performance drop?
- How to update crowd after navmesh update?