예제 #1
0
파일: Base.java 프로젝트: Kagesh/Presidium
  /** Rendering and interface methods- */
  public void renderFor(Rendering rendering) {
    final Viewport port = rendering.port;

    for (Mission mission : missions) {
      final Sprite flag = mission.flagSprite();
      if (!port.intersects(flag.position, 2)) continue;
      rendering.addClient(flag);
    }
  }
예제 #2
0
파일: Base.java 프로젝트: Kagesh/Presidium
 public Mission pickedMission(BaseUI UI, Viewport port) {
   Mission closest = null;
   float minDist = Float.POSITIVE_INFINITY;
   for (Mission mission : missions) {
     final Sprite flag = mission.flagSprite();
     float dist = port.isoToScreen(new Vec3D().setTo(flag.position)).z;
     if (port.mouseIntersects(flag.position, 0.5f, UI)) {
       if (dist < minDist) {
         minDist = dist;
         closest = mission;
       }
     }
   }
   return closest;
 }