Beispiel #1
0
 public boolean isBoundingBoxVisible(BoundingBox box) {
   return (frustum.isPointInside(box.getBottomLeftFrontPoint())
       || frustum.isPointInside(box.getTopRightBackPoint())
       || frustum.isPointInside(box.getBottomLeftBackPoint())
       || frustum.isPointInside(box.getBottomRightFrontPoint())
       || frustum.isPointInside(box.getBottomRightBackPoint())
       || frustum.isPointInside(box.getTopLeftFrontPoint())
       || frustum.isPointInside(box.getTopLeftBackPoint())
       || frustum.isPointInside(box.getTopRightFrontPoint()));
 }
Beispiel #2
0
  public void look(double distanceAway) {
    if (pitch > 1.0) pitch = 0.99;

    if (pitch < -1.0) pitch = -0.99;

    moveForward(10);

    double xLook = xPos;
    double yLook = yPos;
    double zLook = zPos;

    moveForward(-10);

    lookPosition(xLook, yLook, zLook);
    frustum.updatePosition(
        new Vector3f(xPos, yPos, zPos), new Vector3f(xLPos - xPos, yLPos - yPos, zLPos - zPos));
  }
Beispiel #3
0
 public boolean isPointVisible(Vector3f point) {
   return frustum.isPointInside(point);
 }