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

Add friction to all constraint types #75

Closed
jankrassnigg opened this issue Mar 3, 2022 · 4 comments
Closed

Add friction to all constraint types #75

jankrassnigg opened this issue Mar 3, 2022 · 4 comments

Comments

@jankrassnigg
Copy link
Contributor

The friction option on constraints is really nice for tweaking behavior. All of these constraints already support this:

  • hinge
  • swing twist
  • path
  • 6-dof
  • slider

It would be nice to have this also available in these constraints:

  • cone
  • point
@jankrassnigg
Copy link
Contributor Author

On a related note, is it right to assume that constraints with more features either cost more performance, or are less stable, or both.

E.g. prefer point constraint > cone > swing twist > 6-dof ?

@jrouwe
Copy link
Owner

jrouwe commented Mar 3, 2022

I think all joints should be equally stable, but the more complex the logic, the more the cost. From light to heavy (this is a guess, I haven't profiled it):

  • Point
  • Cone
  • Slider/Hinge
  • Swing Twist
  • 6-DOF
  • Path

The point and cone constraints are supposed to be cheap, so I'm not sure if I should add the extra complexity of friction to them. You can easily use a Swing Twist constraint and configure it without limits to get a point constraint, or a Swing Twist constraint with only swing limits to get a cone constraint with friction. The added cost of this should only be a couple of ifs (and a little bit of memory).

@jankrassnigg
Copy link
Contributor Author

My thinking was the other way round: if I don't need twist limit I could use a cone constraint (e.g. in ragdolls) and if I don't need that either, I could use a point constraint. However, I always need the friction functionality.

@jrouwe
Copy link
Owner

jrouwe commented Mar 12, 2022

I've decided to leave this as is. Adding friction to all constraints is going to duplicate code and the performance benefit is minimal compared to using a swing twist constraint with no limits.

@jrouwe jrouwe closed this as completed Mar 12, 2022
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