Skip to content

Commit 0d0c42d

Browse files
committed
VFC example updated
1 parent d15a176 commit 0d0c42d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

examples/demos/ViewFrustumCulling/ViewFrustumCulling.pde

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ Node node(Node parent, Vector vector) {
6969
pg.noFill();
7070
pg.box(a, b, c);
7171
});
72-
// register the visit method only at the main scene
73-
node.setVisit(mainScene, this::cull);
72+
// register the culling method only at the main scene
73+
mainScene.setVisit(node, this::cull);
7474
return node;
7575
}
7676

7777

78-
// The culling method is called just before the graphics(PGraphics) method
79-
public void cull(Graph graph, Node node) {
80-
switch (graph.boxVisibility(node.worldLocation(new Vector(-a / 2, -b / 2, -c / 2)),
78+
// The culling method is called before the node is rendered
79+
public void cull(Node node) {
80+
switch (mainScene.boxVisibility(node.worldLocation(new Vector(-a / 2, -b / 2, -c / 2)),
8181
node.worldLocation(new Vector(a / 2, b / 2, c / 2)))) {
8282
case VISIBLE:
8383
for (Node child : node.children())

0 commit comments

Comments
 (0)