Ejemplo n.º 1
0
 public void TickInvMenu()
 {
     if (CInvMenu != null)
     {
         MainItemView.CameraPos  = -Forw * 10;
         MainItemView.ForwardVec = Forw;
         MainItemView.CameraUp   = () => Location.UnitY; // TODO: Should this really be Y? Probably not...
         View3D temp = MainWorldView;
         MainWorldView = MainItemView;
         MainItemView.Render();
         MainWorldView = temp;
         View3D.CheckError("ItemRender");
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Renders a single frame of the 3D game engine.
 /// </summary>
 public override void RenderSingleFrame()
 {
     // Audio handling
     Sounds.Update(AudioCamera.Position, AudioCamera.Direction, AudioCamera.Up, Location.Zero, Window.Focused);
     // Setup requirements
     GL.Enable(EnableCap.DepthTest);
     GL.Enable(EnableCap.CullFace);
     // Set camera to view
     MainView.CameraPos  = MainCamera.Position;
     MainView.ForwardVec = MainCamera.Direction;
     ZNear = MainCamera.ZNear;
     // Sort entities to prep render
     SortEntities();
     // Render
     MainView.Render();
     // Fix entities back to sorted value (They will be flipped by the render process)
     ReverseEntities();
 }