public static void displayRealm(Realm r) {
    if (Logic.getPlayer() != null) {
      LAYER = BACKGROUND_LAYER;
      setCameraBackground();
      camera.setCameraBound(r.getCameraBound());
      Model background = r.getBackground();
      if (background != null) {
        background.draw(null, null, null);
      }
      camera.setPos(Logic.getPlayer().getPos());
      setCameraLevel();

      LAYER = STATIC_LAYER;
      for (Entity i : r.getEntities()) i.draw();
      for (Entity i : r.getWayPoints()) {
        i.draw();
      }

      LAYER = UNIT_LAYER;
      for (EntityUnit i : r.getUnits()) i.draw();
      LAYER = DYNAMIC_LAYER;
      for (EntityMissile i : r.getMissiles()) i.draw();

      GUI gui = Main.getGameState(STATE_SETTING_MENU).getGUI("GUI_CB_PARTICLES");
      if (gui != null && ((GUICheckBox) gui).getValue()) {
        LAYER = PARTICLE_LAYER;
        for (EntityParticle i : r.getParticles()) i.draw();
      }
    }
  }
Beispiel #2
0
  @Override
  public void draw() {

    if (m != null) {
      Vector3f min = b.getMin();
      Vector3f max = b.getMax();
      glPushMatrix();
      glTranslatef(origin.getX() + min.x, origin.getY() + min.y, origin.getZ() + min.z);
      glRotatef(angle, 0, 1, 0);
      m.draw();
      glPopMatrix();
      glDisable(GL_CULL_FACE);
      glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
      glBegin(GL_QUADS);

      glVertex3f(min.getX(), min.getY(), min.getZ());
      glVertex3f(max.getX(), min.getY(), min.getZ());
      glVertex3f(max.getX(), max.getY(), min.getZ());
      glVertex3f(min.getX(), max.getY(), min.getZ());

      glVertex3f(min.getX(), min.getY(), max.getZ());
      glVertex3f(max.getX(), min.getY(), max.getZ());
      glVertex3f(max.getX(), max.getY(), max.getZ());
      glVertex3f(min.getX(), max.getY(), max.getZ());

      glVertex3f(min.getX(), min.getY(), min.getZ());
      glVertex3f(min.getX(), min.getY(), max.getZ());
      glVertex3f(min.getX(), max.getY(), max.getZ());
      glVertex3f(min.getX(), max.getY(), min.getZ());

      glVertex3f(max.getX(), min.getY(), min.getZ());
      glVertex3f(max.getX(), min.getY(), max.getZ());
      glVertex3f(max.getX(), max.getY(), max.getZ());
      glVertex3f(max.getX(), max.getY(), min.getZ());

      glVertex3f(max.getX(), min.getY(), min.getZ());
      glVertex3f(min.getX(), min.getY(), min.getZ());
      glVertex3f(min.getX(), min.getY(), max.getZ());
      glVertex3f(max.getX(), min.getY(), max.getZ());

      glVertex3f(max.getX(), max.getY(), min.getZ());
      glVertex3f(min.getX(), max.getY(), min.getZ());
      glVertex3f(min.getX(), max.getY(), max.getZ());
      glVertex3f(max.getX(), max.getY(), max.getZ());

      glEnd();
      glEnable(GL_CULL_FACE);
      glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    }
  }