Pathfinding.RelevantGraphSurface.UpdateAllPositions C# (CSharp) Method

UpdateAllPositions() public static method

public static UpdateAllPositions ( ) : void
return void
		public static void UpdateAllPositions () {
			RelevantGraphSurface c = root;
			while (c != null) { c.UpdatePosition (); c = c.Next; }
		}
		

Usage Example

Ejemplo n.º 1
0
        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");
        }
All Usage Examples Of Pathfinding.RelevantGraphSurface::UpdateAllPositions