Skip to content

Commit

Permalink
Use setAnimationLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehorvat committed Jun 4, 2024
1 parent 8d3c81d commit 83e895c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/scene-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ export class SceneManager {

render(containerEl: Element): void {
containerEl.appendChild(this.renderer.domElement);
requestAnimationFrame(this.animate.bind(this));
this.renderer.setAnimationLoop(this.animate.bind(this));
}

/**
* Render the current frame.
*/
private animate(): void {
requestAnimationFrame(this.animate.bind(this));

const delta = this.clock.getDelta();

this.resizeRendererToDisplaySize();
this.rotateSynthesizerUntilRest(delta);
this.maintainSafeCameraDistance();
Expand Down

0 comments on commit 83e895c

Please sign in to comment.