Skip to content

Commit

Permalink
feat: add culler to plans example
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed May 19, 2024
1 parent d90272b commit 5a96f9c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/front/src/fragments/Plans/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ const edges = components.get(OBCF.ClipEdges);
const highlighter = components.get(OBCF.Highlighter);
highlighter.setup({ world });

const cullers = components.get(OBC.Cullers);
const culler = cullers.create(world);
for (const fragment of model.items) {
culler.add(fragment.mesh);
}

culler.needsUpdate = true;

world.camera.controls.addEventListener("sleep", () => {
culler.needsUpdate = true;
});

// Create thick style

const grayFill = new THREE.MeshBasicMaterial({ color: "gray", side: 2 });
Expand Down

0 comments on commit 5a96f9c

Please sign in to comment.