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

Question about islands #720

Closed
chanscredi opened this issue May 11, 2022 · 0 comments
Closed

Question about islands #720

chanscredi opened this issue May 11, 2022 · 0 comments

Comments

@chanscredi
Copy link

chanscredi commented May 11, 2022

When building islands, a graph is created where the vertices are bodies. There is an edge between the bodies if there is a contact or a joint between them.
As a result, we get several graphs that are added to the island one by one and island.Solve() is executed for them.

Question: Can I add graphs not one by one, but all at once for the islands that are used in b2World::Solve? Will the behavior of the bodies change after that?

Why I think so:
As I understand it, only contacts and joints with this body can change the position and speed for it.
This can be done only by those bodies that are with him in the same graph. This means that bodies from another graph do not affect it.
So nothing should change if I add all the graph at once.
I don't worry about additional memoty allocation when expanding the islands.

Thank you.

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

2 participants