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

Extend the Pin Joint to have angle limits and motor #7646

Closed
Ughuuu opened this issue Sep 12, 2023 · 1 comment · Fixed by godotengine/godot#81610
Closed

Extend the Pin Joint to have angle limits and motor #7646

Ughuuu opened this issue Sep 12, 2023 · 1 comment · Fixed by godotengine/godot#81610

Comments

@Ughuuu
Copy link

Ughuuu commented Sep 12, 2023

Describe the project you are working on

A custom godot physics engine for 2d with box2d underneath.

Describe the problem or limitation you are having in your project

I want the plugin that I am developing that is extending/replacing the use of Godot Physics 2D to use nodes to their full potential but also not make users use new nodes to do so.

I want to use some of the features that box2D has to offer in terms of joints:

  • Revolute Joint: Similar to Pin joint. Has extra motor speed, angle limits. Has flag to enable angle limits and motor.

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

Update the PhysicsServer2D api to have angle limits and motor speed and possibly a flag for angle limits and motor speed.

The angle limits, at least for box2d, aren't common for all joint types, so adding it to a function like:
PhysicsServer2D.pin_joint_set_param() would be great.

The following params would need to be exposed:

  • angle_lower_limit
  • angle_upper_limit
  • motor_speed

And for PhysicsServer2D.pin_joint_set_flag:

  • motor_flag
  • angle_limits_flag

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

Not 100% sure of the implementation in godot 2d physics, as I am really interested in the box2d plugin only. If needed, I can look into this one as well.

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

No. Except for adding a new node that does the above mentioned functionality, but then users won't be able to use it as a drop in solution.

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

This helps a lot of use cases that aren't possible with regular Godot Physics 2D solution.

@Ughuuu
Copy link
Author

Ughuuu commented Sep 13, 2023

It would also help build rag dolls, having now angle limits. Also, issues that would benefit from this:

This is similar to the last proposal here, but now it's based more on the box2d implementation, extending all they have(incl motor speed)

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

Successfully merging a pull request may close this issue.

3 participants