RemoveObstacle() public method

public RemoveObstacle ( ObstacleVertex v ) : void
v ObstacleVertex
return void
Exemplo n.º 1
0
        /** Removes obstacles which were added with AddGraphObstacles */
        public void RemoveObstacles()
        {
#if BNICKSON_UPDATED
            if (lastSim != null)
            {
                // if our usage of APP changes, this will throw an error
                throw new System.Exception("This section of A Star Pathfinding code should never be executed");
            }
#else
            if (lastSim == null)
            {
                return;
            }

            Pathfinding.RVO.Simulator sim = lastSim;
            lastSim = null;

            for (int i = 0; i < obstacles.Count; i++)
            {
                sim.RemoveObstacle(obstacles[i]);
            }

            obstacles.Clear();
#endif
        }
Exemplo n.º 2
0
 // destroy the static obstacles we already have
 private void RemoveStaticObstacles(Pathfinding.RVO.Simulator sim)
 {
     if (null != _staticObstacles)
     {
         for (int i = 0; i < _staticObstacles.Count; i++)
         {
             sim.RemoveObstacle(_staticObstacles[i]);
         }
         _staticObstacles.Clear();
     }
 }
Exemplo n.º 3
0
        /// <summary>Removes all obstacles which have been added by this component</summary>
        public void RemoveObstacles()
        {
            if (lastSim != null)
            {
                for (int i = 0; i < obstacles.Count; i++)
                {
                    lastSim.RemoveObstacle(obstacles[i]);
                }
                lastSim = null;
            }

            obstacles.Clear();
        }
Exemplo n.º 4
0
		public void RemoveObstacles()
		{
			if (this.lastSim == null)
			{
				return;
			}
			Simulator simulator = this.lastSim;
			this.lastSim = null;
			for (int i = 0; i < this.obstacles.Count; i++)
			{
				simulator.RemoveObstacle(this.obstacles[i]);
			}
			this.obstacles.Clear();
		}
Exemplo n.º 5
0
    /** Disables the obstacle.
     * Do not override this function
     */
    public void OnDisable()
    {
        if (addedObstacles != null)
        {
            if (sim == null)
            {
                throw new System.Exception("This should not happen! Make sure you are not overriding the OnEnable function");
            }

            for (int i = 0; i < addedObstacles.Count; i++)
            {
                sim.RemoveObstacle(addedObstacles[i]);
            }
        }
    }
Exemplo n.º 6
0
    /** Removes obstacles which were added with AddGraphObstacles */
    public void RemoveObstacles()
    {
        if (lastSim == null)
        {
            return;
        }

        Pathfinding.RVO.Simulator sim = lastSim;
        lastSim = null;

        for (int i = 0; i < obstacles.Count; i++)
        {
            sim.RemoveObstacle(obstacles[i]);
        }

        obstacles.Clear();
    }