Skip to content

Conversation

TouSC
Copy link

@TouSC TouSC commented Aug 26, 2025

Description

This PR adds a missing API to DistanceJoint:

  • A new method setLength(double newLength) to dynamically update the joint’s target length during simulation.
  • A getter length to expose the current target length.

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

@TouSC TouSC changed the title Feature/set length distancejoint feat: Add setLength() to DistanceJoint Aug 26, 2025
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

The field doesn't have to be private if the setter doesn't have to do anything else, but aren't other values affected by you changing the length? I'm guessing it also shouldn't be possible to do this meanwhile the world is locked, or it would probably have some strange side effects.
Have you tried it?

@TouSC
Copy link
Author

TouSC commented Aug 26, 2025

The field doesn't have to be private if the setter doesn't have to do anything else, but aren't other values affected by you changing the length? I'm guessing it also shouldn't be possible to do this meanwhile the world is locked, or it would probably have some strange side effects. Have you tried it?

Sorry, I don’t have the ability to fully test these features, and I don’t really understand the concepts you mentioned. I think it’s best for me to close this PR for now. Hopefully this functionality can be supported in a future release.

@TouSC TouSC closed this Aug 26, 2025
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.

2 participants