public RouteToBeFound(MySmallShipBot bot, MyPositionMemory positionMemory, RouteFoundHandler routeFoundHandler, object userData)
            {
                PositionMemory = positionMemory;
                PositionMemoryIndex = PositionMemory.GetCount() - 1;

                Bot = bot;
                Up = bot.WorldMatrix.Up;
                Position = bot.WorldMatrix.Translation;

                Points = new Vector3[4];
                float delta = 1.0f;
                float scale = 1.0f / MySmallShipConstants.ALL_SMALL_SHIP_MODEL_SCALE;
                Points[0] = new Vector3(Bot.LocalAABB.Max.X * delta * scale, Bot.LocalAABB.Max.Y * delta * scale, Bot.LocalAABB.Max.Z * scale);
                Points[1] = new Vector3(Bot.LocalAABB.Min.X * delta * scale, Bot.LocalAABB.Max.Y * delta * scale, Bot.LocalAABB.Max.Z * scale);
                Points[2] = new Vector3(Bot.LocalAABB.Max.X * delta * scale, Bot.LocalAABB.Min.Y * scale, Bot.LocalAABB.Max.Z * scale);
                Points[3] = new Vector3(Bot.LocalAABB.Min.X * delta * scale, Bot.LocalAABB.Min.Y * scale, Bot.LocalAABB.Max.Z * scale);

                RouteFoundHandler = routeFoundHandler;
                UserData = userData;

                Bot.OnClose += OnCloseBot;
            }
Esempio n. 2
0
            public RouteToBeFound(MySmallShipBot bot, MyPositionMemory positionMemory, RouteFoundHandler routeFoundHandler, object userData)
            {
                PositionMemory      = positionMemory;
                PositionMemoryIndex = PositionMemory.GetCount() - 1;

                Bot      = bot;
                Up       = bot.WorldMatrix.Up;
                Position = bot.WorldMatrix.Translation;

                Points = new Vector3[4];
                float delta = 1.0f;
                float scale = 1.0f / MySmallShipConstants.ALL_SMALL_SHIP_MODEL_SCALE;

                Points[0] = new Vector3(Bot.LocalAABB.Max.X * delta * scale, Bot.LocalAABB.Max.Y * delta * scale, Bot.LocalAABB.Max.Z * scale);
                Points[1] = new Vector3(Bot.LocalAABB.Min.X * delta * scale, Bot.LocalAABB.Max.Y * delta * scale, Bot.LocalAABB.Max.Z * scale);
                Points[2] = new Vector3(Bot.LocalAABB.Max.X * delta * scale, Bot.LocalAABB.Min.Y * scale, Bot.LocalAABB.Max.Z * scale);
                Points[3] = new Vector3(Bot.LocalAABB.Min.X * delta * scale, Bot.LocalAABB.Min.Y * scale, Bot.LocalAABB.Max.Z * scale);

                RouteFoundHandler = routeFoundHandler;
                UserData          = userData;

                Bot.OnClose += OnCloseBot;
            }
 public static void FindRouteInBackground(MySmallShipBot bot, MyPositionMemory route, RouteFoundHandler routeFoundHandler, object userData)
 {
     m_queue.Enqueue(new RouteToBeFound(bot, route, routeFoundHandler, userData));
 }
Esempio n. 4
0
 public static void FindRouteInBackground(MySmallShipBot bot, MyPositionMemory route, RouteFoundHandler routeFoundHandler, object userData)
 {
     m_queue.Enqueue(new RouteToBeFound(bot, route, routeFoundHandler, userData));
 }