Optimize off mesh connections
See merge request OpenMW/openmw!969
(cherry picked from commit 9dcea247d2cd7d25d719fabc142cef5360233e2a)
3e98db8d Fix styleguide
7f65a2c4 Remove unused code
81e569c3 Move OffMeshConnectionsManager implementation into cpp
a8ba9a0e Cleanup unused tile positions from OffMeshConnectionsManager
ff1af5e8 Use only off mesh connections starting or ending in a given tile
1552e7e3 Add pathgrid edges as one direction off mesh connection
Add special loading progress bar.
It should be fast enough to not keep loading screen for noticably long but
will provide better pathfinding for actors inside interior cells.
When distance between start and end point is greater than max radius of area
possibly covered by navmesh there is no way to find path via navmesh. Also if
distance is greater than cell size navmesh might not exists withing mentioned
area because cell is not loaded therefore navmesh is not generated. So minumum
of these values is used to limit max path distance. Assuming that path
actually exists it's possible to build path to the edge of a circle. When
actor reaches initial edge path is built further. However it will not be
optimal.
When there is only one actor (player) on a scene and it moving to other
cell first it will be removed from navigator then added. Remove cause
navmesh removing for its half extents. After it is added navmesh for
same half extents is created and added. While this all happens there are
still jobs for old navmesh are processing. Old navmesh still exists
because it is stored by shared pointer. So jobs take tiles from cache
and place them into old navmesh. After that other jobs take same tiles
from cache (half extents and coordinates are equal) and place them into
other navmesh. dtNavMesh changes tile data on add and remove. Adding tile
to two dtNavMesh corrupts tile in both nameshes.