Skip to content

Commit 08c8491

Browse files
committed
fix(soba): use elapsedTime instead of getElapsedTime()
1 parent 68c5754 commit 08c8491

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

libs/soba/materials/src/lib/mesh-distort-material.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class NgtsMeshDistortMaterial {
3838
inject(DestroyRef).onDestroy(() => this.material.dispose());
3939

4040
injectBeforeRender(({ clock }) => {
41-
this.material.time = clock.getElapsedTime() * this.speed();
41+
this.material.time = clock.elapsedTime * this.speed();
4242
});
4343
}
4444
}

libs/soba/materials/src/lib/mesh-transmission-material.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export class NgtsMeshTransmissionMaterial {
185185
this.side(),
186186
];
187187

188-
material.time = clock.getElapsedTime();
188+
material.time = clock.elapsedTime;
189189
// Render only if the buffer matches the built-in and no transmission sampler is set
190190
// @ts-expect-error - we know material.buffer is not just undefined | null
191191
if (material.buffer === fboMain.texture && !transmissionSampler) {

libs/soba/staging/src/lib/float.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class NgtsFloat {
6868

6969
const container = this.floatRef().nativeElement;
7070

71-
const offsetTime = offset + clock.getElapsedTime();
71+
const offsetTime = offset + clock.elapsedTime;
7272
container.rotation.x = (Math.cos((offsetTime / 4) * speed) / 8) * rotationIntensity;
7373
container.rotation.y = (Math.sin((offsetTime / 4) * speed) / 8) * rotationIntensity;
7474
container.rotation.z = (Math.sin((offsetTime / 4) * speed) / 20) * rotationIntensity;

0 commit comments

Comments
 (0)