Examples: add Worker with SharedArrayBuffer #58
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an example of running physics in a worker using a SharedArrayBuffer.
It is visually the same as the worker example, just the code is different. Instead of doing a ping-pong of the position and rotation data between the worker and the main thread, the data stays just in the SharedArrayBuffer, with cannon writing to it in the worker, and three.js displaying it in the main thread.