Exemplo n.º 1
0
 private void DrawPersistentDebugNavmesh(bool force)
 {
     if (this.m_newVisualNavmesh != null)
     {
         this.m_visualNavmesh    = this.m_newVisualNavmesh;
         this.m_newVisualNavmesh = null;
         force = true;
     }
     if (force)
     {
         if (this.m_visualNavmesh.Count > 0)
         {
             if (this.m_drawNavmeshID == uint.MaxValue)
             {
                 this.m_drawNavmeshID = MyRenderProxy.DebugDrawMesh(this.m_visualNavmesh, MatrixD.Identity, true, true);
             }
             else
             {
                 MyRenderProxy.DebugDrawUpdateMesh(this.m_drawNavmeshID, this.m_visualNavmesh, MatrixD.Identity, true, true);
             }
         }
         else
         {
             this.HidePersistentDebugNavmesh();
         }
     }
 }
Exemplo n.º 2
0
 private void DrawPersistentDebugNavmesh()
 {
     foreach (KeyValuePair <Vector2I, List <MyFormatPositionColor> > pair in this.m_newObbCoordsPolygons)
     {
         if (this.m_newObbCoordsPolygons[pair.Key] == null)
         {
             this.m_obbCoordsPolygons.Remove(pair.Key);
             continue;
         }
         this.m_obbCoordsPolygons[pair.Key] = pair.Value;
     }
     this.m_newObbCoordsPolygons.Clear();
     if (this.m_obbCoordsPolygons.Count > 0)
     {
         List <MyFormatPositionColor> vertices = new List <MyFormatPositionColor>();
         foreach (List <MyFormatPositionColor> list2 in this.m_obbCoordsPolygons.Values)
         {
             int num = 0;
             while (num < list2.Count)
             {
                 vertices.Add(list2[num]);
             }
         }
         if (this.m_drawNavmeshID == uint.MaxValue)
         {
             this.m_drawNavmeshID = MyRenderProxy.DebugDrawMesh(vertices, MatrixD.Identity, true, true);
         }
         else
         {
             MyRenderProxy.DebugDrawUpdateMesh(this.m_drawNavmeshID, vertices, MatrixD.Identity, true, true);
         }
     }
 }