Skip to content

Commit

Permalink
check deltatime (plus fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
JGantts committed Nov 23, 2024
1 parent c4f8e0a commit 7459f10
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions jgantts-com/src/Curtain/Curtain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@ async function initializeCurtain() {
let clientWidthInitial = 0
let clientHeightInitial = 0
let state: AnimationState|null = null
async function renderLoop() {
let state: AnimationState|null = null
await pauseMutex.runExclusive(async () => {
if (playStateInternal == BackgroundState.AfterFirstPaused) {
return
}
while((state = await renderScene(state)) == AnimationState.AboveTop);
do {
state = await renderScene(state)
} while(state == null || state == AnimationState.AboveTop)
if (state == AnimationState.Inside) {
window.requestAnimationFrame(renderLoop)
}
Expand Down Expand Up @@ -279,11 +281,11 @@ async function renderScene(state: AnimationState|null): Promise<AnimationState>
deltaTime = 1
} else {
let currentTime = performance.now()
deltaTime = (currentTime - previousTime) / 40
deltaTime = (currentTime - previousTime) / 20
previousTime = currentTime
}
}
console.log(deltaTime)
for (let index=0; index < gaussianObjects.length; index++) {
Expand Down

0 comments on commit 7459f10

Please sign in to comment.