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

Resolve collisions independently, in parallel? #25

Closed
mbostock opened this issue May 3, 2016 · 1 comment
Closed

Resolve collisions independently, in parallel? #25

mbostock opened this issue May 3, 2016 · 1 comment
Assignees

Comments

@mbostock
Copy link
Member

mbostock commented May 3, 2016

As an alternative to #24, I should consider resolving collisions independently: aggregate the forces for each overlapping node, and then apply them at the end after determining all the overlaps. I did this before looking at the previous position ⟨x,y⟩ and it was too soft, but maybe it would be sufficient when looking at the next position ⟨x + vx,y + vy⟩?

Also if we do this, the forces should be divided in half, since they will apply symmetrically to each pair of overlapping nodes. And it means we don’t have to mutate the quadtree as we iterate over the nodes, and we could probably compare indexes i < j to determine whether we need to test two nodes for overlap.

@mbostock mbostock self-assigned this May 3, 2016
@mbostock
Copy link
Member Author

mbostock commented May 3, 2016

And since we’re not mutating the quadtree, we could compute the maximum radius of each quadrant (rather than the maximum radius of all nodes), potentially allowing for much faster testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant