Skip to content

Commit

Permalink
missed cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
magcius committed Dec 24, 2024
1 parent 562d726 commit 10f51f1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ZeldaWindWaker/d_particle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ export class dPa_control_c {
const inc = viewerInput.deltaTime / 1000 * 30;

// Some hacky distance culling for emitters.
getMatrixTranslation(scratchVec3a, viewerInput.camera.worldMatrix);
for (let i = 0; i < this.emitterManager.aliveEmitters.length; i++) {
const emitter = this.emitterManager.aliveEmitters[i];
const cullDistance = (emitter as any).cullDistance ?? 5000;
if (vec3.distance(emitter.globalTranslation, scratchVec3a) > cullDistance) {
if (vec3.distance(emitter.globalTranslation, globals.camera.cameraPos) > cullDistance) {
emitter.stopCalcEmitter();
emitter.stopDrawParticle();
} else {
Expand Down

0 comments on commit 10f51f1

Please sign in to comment.