Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.
This repository was 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

@urbien

Description

@urbien

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions