Skip to content

Commit d5ebf40

Browse files
aleksanderkataniwoplaza
authored andcommitted
fix: Ripple cube should restart each time the example is opened (#2208)
1 parent 4627843 commit d5ebf40

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • apps/typegpu-docs/src/examples/simple/ripple-cube

apps/typegpu-docs/src/examples/simple/ripple-cube/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ let lastTimestamp = 0;
230230
let isExtendedRipplesEnabled = false;
231231

232232
function run(timestamp: number) {
233-
const deltaTime = (timestamp - lastTimestamp) / 1000;
233+
const deltaTime = lastTimestamp === 0
234+
? 0
235+
: (timestamp - lastTimestamp) / 1000;
234236
lastTimestamp = timestamp;
235237
const maxTime = isExtendedRipplesEnabled ? 62 : 28;
236238
accumulatedTime = Math.min(

0 commit comments

Comments
 (0)