Example #1
0
        public void Init(string iContinent)
        {
            continent = iContinent;

            mpq = new MPQTriangleSupplier();
            mpq.SetContinent(continent);
            triangleWorld = new ChunkedTriangleCollection(512);
            triangleWorld.SetMaxCached(9);
            triangleWorld.AddSupplier(mpq);

            /* After the init routines we create a PathGraph object (as before
               you can replace Kalimdor with whatever you need */

            world = new Pather.Graph.PathGraph(continent, triangleWorld, null);
        }
Example #2
0
        static void Main()
        {
            //This init code is almost copy/pasted from PPather. Depending of where
            //yo are, you can replace Kalimdor with one of:
            //AhnQiraj
            //AhnQirajTemple
            //AlliancePVPBarracks
            //AuchindounDemon
            //AuchindounDraenei
            //AuchindounEthereal
            //AuchindounShadow
            //Azeroth
            //Blackfathom
            //BlackrockDepths
            //BlackRockSpire
            //BlackTemple
            //BlackwingLair
            //bladesedgearena
            //CavernsOfTime
            //CoilfangDraenei
            //CoilfangMarsh
            //CoilfangPumping
            //CoilfangRaid
            //Collin
            //CraigTest
            //DalaranArena
            //DeadminesInstance
            //DeeprunTram
            //development_nonweighted
            //DireMaul
            //EmeraldDream
            //Expansion01
            //GnomeragonInstance
            //GruulsLair
            //HellfireDemon
            //HellfireMilitary
            //HellfireRaid
            //HellfireRampart
            //HillsbradPast
            //HordePVPBarracks
            //HyjalPast
            //Kalimdor
            //Karazahn
            //Mauradon
            //MoltenCore
            //Monastery
            //MonasteryInstances
            //NetherstormBG
            //OnyxiaLairInstance
            //OrgrimmarArena
            //OrgrimmarInstance
            //PVPLordaeron
            //PVPZone01
            //PVPZone02
            //PVPZone03
            //PVPZone04
            //PVPZone05
            //RazorfenDowns
            //RazorfenKraulInstance
            //SchoolofNecromancy
            //ScottTest
            //Shadowfang
            //StormwindJail
            //StormwindPrison
            //Stratholme
            //SunkenTemple
            //Sunwell5Man
            //Sunwell5ManFix
            //SunwellPlateau
            //TanarisInstance
            //TempestKeepArcane
            //TempestKeepAtrium
            //TempestKeepFactory
            //TempestKeepRaid
            //test
            //Uldaman
            //WailingCaverns
            //Zul'gurub
            //ZulAman

            var mpq = new MPQTriangleSupplier();
            mpq.SetContinent("Expansion01");
            var triangleWorld = new ChunkedTriangleCollection(512);
            triangleWorld.SetMaxCached(9);
            triangleWorld.AddSupplier(mpq);

            /* After the init routines we create a PathGraph object (as before
               you can replace Kalimdor with whatever you need */

            var world = new Pather.Graph.PathGraph("Expansion01", triangleWorld, null);

            // Here we define the starting point (somewhere in the orc noob village)

            var origin = new Pather.Graph.Location(240.94f, 2692.39f, 89.74f);

            // Here we define our destination (somewhere in Razor Hill)

            var destination = new Pather.Graph.Location(189.63f, 2690.94f, 88.71f);

            // We try to find a path

            var mypath = world.CreatePath(origin, destination, 5f);

            /* We save the PathGraph. Stores every chunk of the map we used in the
               PPather\PathInfo\{map} folder */

            world.Save();

            // Print the path

            Console.WriteLine("Second attempt. Press a key");
            Console.ReadKey();

            mypath = world.CreatePath(origin, destination, 5f);

            Console.WriteLine("Third attempt. Press a key");
            Console.ReadKey();

            mypath = world.CreatePath(origin, destination, 5f);

            // Print the path

            Console.WriteLine("Press a key to print the path");
            Console.ReadKey();

            foreach (Pather.Graph.Location loc in mypath.locations)
            {
                Console.WriteLine("X: {0}  Y: {1}   Z: {2}", loc.X, loc.Y, loc.Z);
            }

            Console.WriteLine("End of program. Press a key");
            Console.ReadKey();
        }