Skip to content

Conversation

@spydon
Copy link
Member

@spydon spydon commented Oct 26, 2025

Description

This fixes so that the queued up joints are actually created and destroyed when the world is stepped.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Related Issues

@drrnbrns
Copy link
Contributor

As requested, I tried this branch locally and yes, it does appear to fix the issue I encountered. Joints are now created as expected (I didn't try destroying joints but the code looks good to me).

Since earlier versions just asserted that the world wasn't locked, my project has always queued such operations. When adding new code, I just forgot to queue and hit the issue. So I won't actually depend on this fix since I'll continue to queue operations myself, but I think it's definitely a good fix to have.

Note that making the lists private is technically a breaking change, but it's unlikely anyone would access them.

Thank you for the speedy update!

@spydon
Copy link
Member Author

spydon commented Oct 26, 2025

Note that making the lists private is technically a breaking change, but it's unlikely anyone would access them.

Yeah, I had the same thinking, so didn't mark it as breaking.

I'll publish a new version once I get a review from someone else in the team.

bodiesToDestroy.clear();
_bodiesToDestroy.clear();

for (final joint in _jointsToCreate) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this just... never worked? haha

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha yeah, but it's quite new

Copy link
Member

@luanpotter luanpotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luanpotter luanpotter merged commit 0704959 into main Oct 26, 2025
3 checks passed
@luanpotter luanpotter deleted the fix/create-joints-during-locked branch October 26, 2025 18:56
@spydon
Copy link
Member Author

spydon commented Oct 26, 2025

@drrnbrns it's now released :)

@drrnbrns
Copy link
Contributor

@drrnbrns it's now released :)

@spydon Thanks a lot for the high-quality fix (i.e. with tests) in less than 24 hours!

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

Successfully merging this pull request may close these issues.

4 participants