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 angular_limit to PinJoint #4224

Open
DiamondWolf3393 opened this issue Mar 16, 2022 · 1 comment
Open

Add angular_limit to PinJoint #4224

DiamondWolf3393 opened this issue Mar 16, 2022 · 1 comment

Comments

@DiamondWolf3393
Copy link

Describe the project you are working on

A 2D physics simulation game that makes heavy use of active ragdolls.

Describe the problem or limitation you are having in your project

The node "PinJoint2D" which is what I am using to hold the ragdolls together lacks an angular_limit parameter. This allows the joints to rotate freely, which is not what I want.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

The angular_limit parameter would be paired with some sort of limit strength in order to determine the rotation limits of the joint, and how hard it would pull back once brought out of the limits.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

The angular_limit parameter when non-zero prevents the rotation of node_b relative to node_a beyond a certain point. The angular_limit_strength parameter would determine how hard to pull the node back within the limits. This could possibly work by setting the angular_velocity of node_b if it is out of the limits.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I can imagine this enhancement being used frequently, but I haven't fully figured out the code to create it myself yet. I am still trying though.

Is there a reason why this should be core and not an add-on in the asset library?

This would match the 2D physics systems closer to the 3D physics systems and allow game developers creating 2D ragdolls to have an easier time.

@Calinou Calinou changed the title angular_limit for PinJoint2D Add angular_limit to PinJoint Mar 16, 2022
@James103
Copy link

See also #1033.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants