@Override public boolean checkCulling(Camera cam) { if (isGrouped()) { setLastFrustumIntersection(Camera.FrustumIntersect.Outside); return false; } return super.checkCulling(cam); }
private static void validateSubScene(Spatial scene) { scene.checkCulling(DUMMY_CAM); Set<MatParamOverride> actualOverrides = new HashSet<MatParamOverride>(); for (MatParamOverride override : scene.getWorldMatParamOverrides()) { actualOverrides.add(override); } Set<MatParamOverride> expectedOverrides = new HashSet<MatParamOverride>(); Spatial current = scene; while (current != null) { for (MatParamOverride override : current.getLocalMatParamOverrides()) { expectedOverrides.add(override); } current = current.getParent(); } assertEquals("For " + scene, expectedOverrides, actualOverrides); }
private void renderSubScene(Spatial scene, ViewPort vp) { // check culling first. if (!scene.checkCulling(vp.getCamera())) { return; } scene.runControlRender(this, vp); if (scene instanceof Node) { // Recurse for all children Node n = (Node) scene; List<Spatial> children = n.getChildren(); // Saving cam state for culling int camState = vp.getCamera().getPlaneState(); for (int i = 0; i < children.size(); i++) { // Restoring cam state before proceeding children recursively vp.getCamera().setPlaneState(camState); renderSubScene(children.get(i), vp); } } else if (scene instanceof Geometry) { // add to the render queue Geometry gm = (Geometry) scene; if (gm.getMaterial() == null) { throw new IllegalStateException("No material is set for Geometry: " + gm.getName()); } vp.getQueue().addToQueue(gm, scene.getQueueBucket()); } }
int planeState = camera.getPlaneState(); camera.setPlaneState(0); inFrustum = camera.contains(scene.getWorldBound()) != Camera.FrustumIntersect.Outside && scene.checkCulling(vpCamera); camera.setPlaneState(planeState);
@Override public boolean checkCulling(Camera cam) { if (isGrouped()) { setLastFrustumIntersection(Camera.FrustumIntersect.Outside); return false; } return super.checkCulling(cam); }
private void renderSubScene(Spatial scene, ViewPort vp) { // check culling first. if (!scene.checkCulling(vp.getCamera())) { return; } scene.runControlRender(this, vp); if (scene instanceof Node) { // Recurse for all children Node n = (Node) scene; List<Spatial> children = n.getChildren(); // Saving cam state for culling int camState = vp.getCamera().getPlaneState(); for (int i = 0; i < children.size(); i++) { // Restoring cam state before proceeding children recursively vp.getCamera().setPlaneState(camState); renderSubScene(children.get(i), vp); } } else if (scene instanceof Geometry) { // add to the render queue Geometry gm = (Geometry) scene; if (gm.getMaterial() == null) { throw new IllegalStateException("No material is set for Geometry: " + gm.getName()); } vp.getQueue().addToQueue(gm, scene.getQueueBucket()); } }
int planeState = camera.getPlaneState(); camera.setPlaneState(0); inFrustum = camera.contains(scene.getWorldBound()) != Camera.FrustumIntersect.Outside && scene.checkCulling(vpCamera); camera.setPlaneState(planeState);
if (!scene.checkCulling(vp.getCamera())) {