Пример #1
0
        public Movement()
        {
            if (!Manager.ObjectManager.IsInGame)
                return;

            CurrentMap = WoWWorld.CurrentMap;
            PatherInstance = new Pather(CurrentMap);
        }
Пример #2
0
        public Movement()
        {
            if (!Manager.ObjectManager.IsInGame)
            {
                return;
            }

            CurrentMap     = World.CurrentMap;
            PatherInstance = new Pather(CurrentMap);
        }
Пример #3
0
        private void btnGenPath_Click(object sender, EventArgs e)
        {
            if (!Manager.ObjectManager.IsInGame)
                return;

            if (_pos1 == default(Location) || _pos2 == default(Location))
                return;

            try
            {
                var map = WoWWorld.CurrentMap;
                Log.WriteLine("Generate path from {0} to {1} in {2}", _pos1, _pos2, map);
                var pathInstance = new Pather(map);
                var path = pathInstance.FindPath(_pos1, _pos2, false);
                if (path != null && path.Count() > 0)
                {
                    Log.WriteLine("NavMesh generated waypoints:");
                    foreach (var pt in path)
                        Log.WriteLine("\t{0}", pt);
                }
            }
            catch (Exception ex)
            {
                Log.WriteLine("NavMesh: {0}", ex.Message);
            }
        }
Пример #4
0
        private void btnGenPath_Click(object sender, EventArgs e)
        {
            if (!Manager.ObjectManager.IsInGame)
                return;

            if (_pos1 == default(Location) || _pos2 == default(Location))
                return;

            try
            {
                string map = WoWWorld.CurrentMap;
                Log.WriteLine("Generate path from {0} to {1} in {2}", _pos1, _pos2, map);
                var mesh = new Pather("Kalimdor");
                mesh.LoadAppropriateTiles(_pos1.ToVector3(), _pos2.ToVector3());
                List<Vector3> path = mesh.DetourMesh.FindPath(_pos1.ToFloatArray(), _pos2.ToFloatArray(), false);
                foreach (Vector3 point in path)
                    Log.WriteLine("[{0}]", point.ToString());
            }
            catch (Exception ex)
            {
                Log.WriteLine("NavMesh: {0}", ex.Message);
            }
        }
Пример #5
0
        public bool PathTo(Location pos)
        {
            if (!Manager.ObjectManager.IsInGame)
                return false;

            if (CurrentMap != WoWWorld.CurrentMap)
            {
                CurrentMap = WoWWorld.CurrentMap;
                PatherInstance = new Pather(CurrentMap);
            }

            if (PatherInstance == null)
                return false;

            Destination = pos;
            var path = PatherInstance.FindPath(Manager.LocalPlayer.Location, pos, false);
            //var path = PatherInstance.FindPath(Manager.LocalPlayer.Location, pos.ToVector3());
            if (path == null)
            {
                Log.WriteLine("Could not path to {0}", pos);
                return false;
            }

            FollowPath(path.ToLocation());

            return true;
        }