Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

how should the time be synchronized between the main thread (renderer) and the webworker (world)? #6

Open
urbien opened this issue Dec 16, 2013 · 0 comments

Comments

@urbien
Copy link
Owner

urbien commented Dec 16, 2013

We implemented the world in the web worker. The main thread (renderer) is stepped by a requestAnimationFrame (raf). How should the world be stepped?

  1. move them synchronously. Raf issues postMessage to worker to step the world.
  2. move them independently. Use a timeout in the worker with interval 1000/60. May be interval needs to be a 1000/(60*2)
  3. move them independently but do not let the world to go ahead too much. Not sure I understand this solution but it is what cannon.js does in this example

This issue may depend on the design of #4 for variable timeframe physics.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant