void IUpdatableGraph.UpdateAreaInit(GraphUpdateObject o)
{
if (!o.updatePhysics)
{
return;
}
AstarProfiler.Reset();
AstarProfiler.StartProfile("UpdateAreaInit");
AstarProfiler.StartProfile("CollectMeshes");
RelevantGraphSurface.UpdateAllPositions();
// Calculate world bounds of all affected tiles
// Expand TileBorderSizeInWorldUnits voxels in all directions to make sure
// all tiles that could be affected by the update are recalculated.
IntRect touchingTiles = GetTouchingTiles(o.bounds, TileBorderSizeInWorldUnits);
Bounds tileBounds = GetTileBounds(touchingTiles);
// Expand TileBorderSizeInWorldUnits voxels in all directions to make sure we grab all meshes that could affect the tiles.
tileBounds.Expand(new Vector3(1, 0, 1) * TileBorderSizeInWorldUnits * 2);
var meshes = CollectMeshes(tileBounds);
if (globalVox == null)
{
// Create the voxelizer and set all settings
globalVox = new Voxelize(CellHeight, cellSize, walkableClimb, walkableHeight, maxSlope, maxEdgeLength);
}
globalVox.inputMeshes = meshes;
AstarProfiler.EndProfile("CollectMeshes");
AstarProfiler.EndProfile("UpdateAreaInit");
}