/** Returns whether the given bounding box is in the frustum. * @return Whether the bounding box is in the frustum */ public boolean boundsInFrustum (Vector3 center, Vector3 dimensions) { return boundsInFrustum(center.x, center.y, center.z, dimensions.x / 2, dimensions.y / 2, dimensions.z / 2); }
/** Returns whether the given bounding box is in the frustum. * @return Whether the bounding box is in the frustum */ public boolean boundsInFrustum (Vector3 center, Vector3 dimensions) { return boundsInFrustum(center.x, center.y, center.z, dimensions.x / 2, dimensions.y / 2, dimensions.z / 2); }
@Override public boolean filter (BaseLight light, Camera camera, Camera mainCamera) { Frustum f1 = mainCamera.frustum; Frustum f2 = camera.frustum; bb.inf(); for (int i = 0; i < f2.planePoints.length; i++) { bb.ext(f2.planePoints[i]); } if (f1.boundsInFrustum(bb)) { return true; } return false; } }
private void renderDebug () { debugRenderer.setProjectionMatrix(camera.combined); debugRenderer.begin(ShapeType.Line); debugRenderer.setColor(Color.RED); debugRenderer.rect(koala.position.x, koala.position.y, Koala.WIDTH, Koala.HEIGHT); debugRenderer.setColor(Color.YELLOW); TiledMapTileLayer layer = (TiledMapTileLayer)map.getLayers().get("walls"); for (int y = 0; y <= layer.getHeight(); y++) { for (int x = 0; x <= layer.getWidth(); x++) { Cell cell = layer.getCell(x, y); if (cell != null) { if (camera.frustum.boundsInFrustum(x + 0.5f, y + 0.5f, 0, 1, 1, 0)) debugRenderer.rect(x, y, 1, 1); } } } debugRenderer.end(); }
/** Returns whether the given bounding box is in the frustum. * @return Whether the bounding box is in the frustum */ public boolean boundsInFrustum (Vector3 center, Vector3 dimensions) { return boundsInFrustum(center.x, center.y, center.z, dimensions.x / 2, dimensions.y / 2, dimensions.z / 2); }
if(frustum.boundsInFrustum(x, y, 0f, widthInc, -heightInc, 0f)) textFactory.draw(batch, entry.charValue, entry.floatValue, x, y);
if(frustum.boundsInFrustum(x, y, 0f, widthInc, -heightInc, 0f)) textFactory.draw(batch, replacement, entry.floatValue, x, y);
(!camera.frustum.boundsInFrustum(xo, yOff - font.actualCellHeight - 1f, 0f, font.actualCellWidth, font.actualCellHeight, 0f) || !camera.frustum.boundsInFrustum(xo + font.actualCellWidth * (gridWidth-1), yo, 0f, font.actualCellWidth, font.actualCellHeight, 0f)) (x = Math.round((gxo = glyph.getX() - xo) / font.actualCellWidth)) < 0 || x >= gridWidth || (y = Math.round((gyo = glyph.getY() - yo) / -font.actualCellHeight + gridHeight)) < 0 || y >= gridHeight || backgrounds[x * 3 + 1][y * 3 + 1] == 0f || (frustum != null && !frustum.boundsInFrustum(gxo, gyo, 0f, font.actualCellWidth, font.actualCellHeight, 0f))) continue; glyph.draw(batch, 1f);
(!camera.frustum.boundsInFrustum(xo, yOff - font.actualCellHeight - 1f, 0f, font.actualCellWidth, font.actualCellHeight, 0f) || !camera.frustum.boundsInFrustum(xo + font.actualCellWidth * (gridWidth-1), yo, 0f, font.actualCellWidth, font.actualCellHeight, 0f)) (x = Math.round((gxo = glyph.getX() - xo) / font.actualCellWidth)) < 0 || x >= gridWidth || (y = Math.round((gyo = glyph.getY() - yo) / -font.actualCellHeight + gridHeight)) < 0 || y >= gridHeight || backgrounds[x][y] == 0f || (frustum != null && !frustum.boundsInFrustum(gxo, gyo, 0f, font.actualCellWidth, font.actualCellHeight, 0f))) continue; glyph.draw(batch, 1f);
if (Config.Debug.FrustumCulling && !camPersp.frustum.boundsInFrustum(m.boundingBox)) { needRebind = true; if (!depthOnly) culledMeshes++;
if (Config.Debug.FrustumCulling && !camPersp.frustum.boundsInFrustum(m.boundingBox)) { needRebind = true; if (!depthOnly) culledMeshes++;
int midZ = z + halfWidth; int midY = c.getHighestPoint() / 2; boolean visible = RadixClient.getInstance().getGameRenderer().getFrustum().boundsInFrustum(midX, midY, midZ, halfWidth, midY, halfWidth); if (visible) { visibleChunks.add(c);
private boolean renderCar (Car car, boolean depthOnly, boolean nightMode) { CarStillModel model = car.getStillModel(); if (Config.Debug.FrustumCulling && !camPersp.frustum.boundsInFrustum(model.boundingBox)) { return false;