Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outlines for making high-particle-count real-time toy simulation #1

Open
magwo opened this issue Jul 29, 2015 · 0 comments
Open

Outlines for making high-particle-count real-time toy simulation #1

magwo opened this issue Jul 29, 2015 · 0 comments

Comments

@magwo
Copy link
Owner

magwo commented Jul 29, 2015

  • Screw barnes-hut. Too much memory thrashing for modern architectures (I'm making this up).
  • Off-load N-body simulation to a web worker, and:
    • Use a very compact linear memory structure, probably typed arrays for positions ,velocities, mass, all mashed into one big array with named indices for access.
    • Find out the most efficient memory order in which to do direct N-body. Maybe even duplication for increased memory linearity?
    • Split simulation into near/far interactions. Probably only two levels to avoid memory usage.
  • Keep a rich-object copy of all the N bodies in the non-web-worker code, and:
    • Update positions, velocities and accelerations when web worker outputs them
    • Extrapolate form position, velocity, accelerations, and:
      • Soft-snap to new correct position when available
    • Handle visual-effects-only particles particles, let them gravitate toward the N bodies (using very soft Plummer model?). Should probably also use near/far update intervals, or simply use sqr distance threshold).
  • Probably use Plummer model for gravity
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

No branches or pull requests

1 participant