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

Stiffness option for springs in Jolt joints #748

Open
phelioz opened this issue Jan 14, 2024 · 4 comments
Open

Stiffness option for springs in Jolt joints #748

phelioz opened this issue Jan 14, 2024 · 4 comments
Labels
enhancement New feature or request topic:runtime Concerning runtime behavior (or its source code)

Comments

@phelioz
Copy link

phelioz commented Jan 14, 2024

It would be great to be able to use stiffness or frequency for springs in the Jolt joints. While you can just use the regular joints if you want to use stiffness, these don't allow for breakable joints because you can't access the applied force / torque.

The frequency setting for springs in Jolt joints is fantastic for many situations, providing a specific type of behavior that works independently of mass.

However, stiffness becomes incredibly useful when simulating a certain kind of strength. By adjusting stiffness, you can effectively set a 'strength' level. This feature is particularly valuable when simulating something like a character's muscle strength or the lifting capability of a machine.

@github-actions github-actions bot added the needs triage Something that needs investigation label Jan 14, 2024
@phelioz phelioz changed the title Stiffness in Jolt joints Stiffness for springs in Jolt joints Jan 14, 2024
@phelioz phelioz changed the title Stiffness for springs in Jolt joints Stiffness option for springs in Jolt joints Jan 14, 2024
@mihe
Copy link
Contributor

mihe commented Jan 14, 2024

Yeah, this is something I've been thinking about for a while now as well. I think it's a good idea, and would probably be trivial to add. I just need to figure out some way of dynamically switching out the property fields based on which mode you set, but I've seen other nodes do that, so it shouldn't be too difficult.

@mihe mihe added enhancement New feature or request topic:runtime Concerning runtime behavior (or its source code) and removed needs triage Something that needs investigation labels Jan 14, 2024
@phelioz
Copy link
Author

phelioz commented Jan 14, 2024

Object::_validate_property(PropertyInfo &p_property) and Object::notify_property_list_changed would probably be enough for dynamically switching out the property fields I think.

Like for example in the Control class where some properties change depending on what the parent is.

@mihe
Copy link
Contributor

mihe commented Jan 14, 2024

That's pretty slick. CSGPolygon3D seems to rely on exactly that as well, for when you enable/disable collision on it.

I need to finish up soft bodies first, so it might be a little while before I get to this.

@phelioz
Copy link
Author

phelioz commented Jan 14, 2024

Yeah CSGPolygon3D was a better example 😄

No stress, nice to know it's planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic:runtime Concerning runtime behavior (or its source code)
Projects
Status: Planned
Development

No branches or pull requests

2 participants