UpdateAllPositions() public static method

public static UpdateAllPositions ( ) : void
return void
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");
        }
Ejemplo n.º 2
0
 public override IEnumerable <Progress> ScanInternal()
 {
     TriangleMeshNode.SetNavmeshHolder(AstarPath.active.data.GetGraphIndex(this), this);
     if (!Application.isPlaying)
     {
         RelevantGraphSurface.FindAllGraphSurfaces();
     }
     RelevantGraphSurface.UpdateAllPositions();
     foreach (Progress progress in this.ScanAllTiles())
     {
         yield return(progress);
     }
     yield break;
 }
Ejemplo n.º 3
0
        // Token: 0x06002629 RID: 9769 RVA: 0x001A7BBC File Offset: 0x001A5DBC
        void IUpdatableGraph.UpdateAreaInit(GraphUpdateObject o)
        {
            if (!o.updatePhysics)
            {
                return;
            }
            RelevantGraphSurface.UpdateAllPositions();
            IntRect touchingTiles = base.GetTouchingTiles(o.bounds);
            Bounds  tileBounds    = base.GetTileBounds(touchingTiles);

            tileBounds.Expand(new Vector3(1f, 0f, 1f) * this.TileBorderSizeInWorldUnits * 2f);
            List <RasterizationMesh> inputMeshes = this.CollectMeshes(tileBounds);

            if (this.globalVox == null)
            {
                this.globalVox = new Voxelize(this.CellHeight, this.cellSize, this.walkableClimb, this.walkableHeight, this.maxSlope, this.maxEdgeLength);
            }
            this.globalVox.inputMeshes = inputMeshes;
        }
Ejemplo n.º 4
0
        protected override IEnumerable <Progress> ScanInternal()
        {
            TriangleMeshNode.SetNavmeshHolder(AstarPath.active.data.GetGraphIndex(this), this);

            if (!Application.isPlaying)
            {
                RelevantGraphSurface.FindAllGraphSurfaces();
            }

            RelevantGraphSurface.UpdateAllPositions();


            foreach (var progress in ScanAllTiles())
            {
                yield return(progress);
            }


#if DEBUG_REPLAY
            DebugReplay.WriteToFile();
#endif
        }