Ejemplo n.º 1
0
        public override CmdResult ExecuteRequest(CmdRequest args)
        {
            int argsUsed;
            var keyargs = args.GetProperty("targets");
            ICollection <SimObject> objs = WorldSystem.GetPrimitives(keyargs, out argsUsed);
            bool rightNow = true;

            if (argsUsed == 0)
            {
                objs     = (ICollection <SimObject>)WorldSystem.GetAllSimObjects();
                rightNow = false;
            }
            WriteLine("Meshing " + objs.Count);
            foreach (SimObject o2 in objs)
            {
                SimObjectPathFinding o = o2.PathFinding;
                o.IsWorthMeshing = true;
                if (rightNow)
                {
                    o.AddCollisionsNow();
                }
                else
                {
                    o.AddCollisions();
                }
            }
            if (rightNow)
            {
                SimRegion.BakeRegions();
            }
            else
            {
                Cogbot.WorldPathSystem.MeshingQueue.Enqueue(SimRegion.BakeRegions);
            }

            return(TheBotClient.ExecuteCommand("meshinfo", args.CallerAgent, args.Output, args.CmdFlags));
        }
Ejemplo n.º 2
0
        public override CmdResult ExecuteRequest(CmdRequest args)
        {
            int argsUsed;
            ICollection <SimObject> objs;
            bool rightNow = true;

            if (!args.TryGetValue("targets", out objs))
            {
                objs     = (ICollection <SimObject>)WorldSystem.GetAllSimObjects();
                rightNow = false;
            }
            WriteLine("Unmeshing " + objs.Count);
            foreach (SimObject o2 in objs)
            {
                SimObjectPathFinding o = o2.PathFinding;

                o.IsWorthMeshing = true;
                if (rightNow)
                {
                    o.RemoveCollisions();
                }
                else
                {
                    o.RemoveCollisions();
                }
            }
            if (rightNow)
            {
                TheSimAvatar.GetSimRegion().GetPathStore(TheSimAvatar.SimPosition).RemoveAllCollisionPlanes();
            }
            else
            {
                TheSimAvatar.GetSimRegion().GetPathStore(TheSimAvatar.SimPosition).RemoveAllCollisionPlanes();
            }

            return(TheBotClient.ExecuteCommand("meshinfo", args.CallerAgent, args.Output, args.CmdFlags));
        }