Skip to content

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Feb 18, 2025

Related issue: #30522 (comment)

Description

The PR implements connect()/disconnect() to make the ctor side-effect free.

This change must be noted in the migration guide since calling timer.connect( document ); is now mandatory if the Page Visibility API should be used to avoid large time delta values.

@Mugen87 Mugen87 added this to the r174 milestone Feb 18, 2025
@sunag
Copy link
Collaborator

sunag commented Feb 19, 2025

Could this be connected to the Renderer? Maybe this helps to synchronize the time and deltaTime node with the Timer.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 19, 2025

Maybe something like:

renderer.setTimer( timer );

In this way, the renderer could call timer.update() internally.

@sunag
Copy link
Collaborator

sunag commented Feb 19, 2025

I think one timer should come as default in the Renderer, so it can use renderer.getTimer() in the examples if you prefer. Synchronization will help to pause the game for example and preserve the shader's momentum, currently this is only possible if the user creates an isolated timer uniform

@Mugen87 Mugen87 merged commit 7438a35 into mrdoob:dev Feb 20, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants