Skip to content

Conversation

@Eideren
Copy link
Collaborator

@Eideren Eideren commented Oct 13, 2025

PR Details

See title. Could be used to detach a constraint when under too much strain, dynamically measure a constraint to adjust other constraint strengths, play different straining sound effect based on those values, ...

Related Issue

None.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Eideren Eideren merged commit b3cbfb9 into stride3d:master Oct 19, 2025
7 checks passed
@Eideren Eideren deleted the constraint_impulses branch October 19, 2025 15:15
public abstract bool Attached { get; }

/// <summary>
/// Returns the squared sum of all impulses this constraint applied on the last tick
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a nit: The doc says "Returns the squared sum of all...", but your implementation above does a MathF.Sqrt(). Is that correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, I intended to replicate bepu's api on that front, but ended up forcing a sqrt as I did not see any cases were one would prefer a squared version. I'll make a PR in a bit to fix this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Normally squared versions are nice for checking relative magnitudes (i.e. checking if not zero, or comparing A > B, or comparing against a precomputed threshold). In those cases, it is sufficient to get the squared magnitude and save a square root.
Anyway, I'm not very into physics simulations these days, so you may know better 😀.

Eideren added a commit to Eideren/xenko that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants