Пример #1
0
        public Navmesh(Engine engine, ExplorationEngine explorator, bool verbose = false)
            : base(explorator, verbose)
        {
            using (new Profiler("[Nav.D3] Loading SNO data cache took {t}."))
                LoadSnoCache();

            m_Engine = engine;
            m_FetchNavDataTimer.AutoReset = false;
            m_FetchNavDataTimer.Interval  = 300;
            m_FetchNavDataTimer.Elapsed  += new ElapsedEventHandler(FetchData);
            m_FetchNavDataTimer.Start();

            DangerRegionsEnabled = false;

            m_FetchDangerRegionsTimer.AutoReset = false;
            m_FetchDangerRegionsTimer.Interval  = 100;
            m_FetchDangerRegionsTimer.Elapsed  += new ElapsedEventHandler(FetchDangerRegions);
            m_FetchDangerRegionsTimer.Start();

            Log("[Nav.D3] Navmesh created!");
        }
Пример #2
0
        public Navmesh(Engine engine, ExplorationEngine explorator, bool verbose = false)
            : base(explorator, verbose)
        {
            using (new Profiler("[Nav.D3] Loading SNO data cache took {t}."))
                LoadSnoCache();

            m_Engine = engine;
            m_FetchNavDataTimer.AutoReset = false;
            m_FetchNavDataTimer.Interval = 300;
            m_FetchNavDataTimer.Elapsed += new ElapsedEventHandler(FetchData);
            m_FetchNavDataTimer.Start();

            DangerRegionsEnabled = false;

            m_FetchDangerRegionsTimer.AutoReset = false;
            m_FetchDangerRegionsTimer.Interval = 100;
            m_FetchDangerRegionsTimer.Elapsed += new ElapsedEventHandler(FetchDangerRegions);
            m_FetchDangerRegionsTimer.Start();            

            Log("[Nav.D3] Navmesh created!");
        }
Пример #3
0
        public TestBot(Nav.Navmesh navmesh, NavigationEngine navigator, ExplorationEngine explorer, Vec3 pos, Vec3 dest, bool explore = false, bool simulate_stuck = false, int dest_grid_id = -1, List <Vec3> waypoints = null)
        {
            m_Navmesh = navmesh;
            //m_Navigator = new NavigationEngine(navmesh);
            //m_Navigator.AddObserver(this);
            m_Navigator                    = navigator;
            m_Navigator.CurrentPos         = pos;
            m_Navigator.Precision          = 2;
            m_Navigator.EnableAntiStuck    = true;
            m_Navigator.DestinationGridsId = dest_grid_id != -1 ? new List <int>(new int[] { dest_grid_id }) : null;
            if (waypoints != null)
            {
                m_Navigator.Waypoints = waypoints;
            }

            //m_Explorer = new Nav.ExploreEngine.Nearest(m_Navmesh, m_Navigator);
            m_Explorer         = explorer;
            m_Explorer.Enabled = explore;

            Destination   = dest;
            SimulateStuck = simulate_stuck;
            Paused        = false;
            m_GotoPosUpdateTimer.Start();
        }
Пример #4
0
 public static Navmesh Create(Engine engine, ExplorationEngine explorator = null, bool verbose = false)
 {
     return(Current = new Navmesh(engine, explorator, verbose));
 }
Пример #5
0
 public static Navmesh Create(Engine engine, ExplorationEngine explorator = null, bool verbose = false)
 {
     return Current = new Navmesh(engine, explorator, verbose);
 }