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 methods, properties and signals that are present in RigidBody3D to PhysicalBone3D #8008

Open
ruanrothmann opened this issue Oct 6, 2023 · 2 comments

Comments

@ruanrothmann
Copy link

Describe the project you are working on

An active ragdoll game in the style of GORN, TABS, Human Fall Flat, etc

Describe the problem or limitation you are having in your project

There are several methods, properties and signals that are present in Rigidbody3D that are not present in PhysicalBone3D, even though the functionality likely exists and they are very useful for manipulating active ragdolls.

For example, PhysicalBone3D has no 'sleep' property, even though it has a "can_sleep" property. Other notable omissions:

apply_force()
apply_torque()
center_of_mass
get_colliding_bodies()
body_entered
body_exited
body_shape_entered
body_shape_exited

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

Active ragdoll games are quite popular, but currently somewhat limited due to these missing features of PhysicalBone3D

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

Simply, I'd like to use a physicalbone3d as I can a rigidbody3d, as from a developer POV they are the same thing.

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

You can approximate apply_force by using apply_impulce (force * delta), but some of the other missing properties are much harder to work around. The missing signals, especially, do not have a clean workaround as far as I can tell.

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

This is core functionality already present in the engine that just needs to be exposed somewhere else, as far as I can tell.

@Calinou Calinou changed the title Add methods, properties and signals that are present in Rigidbody3D to PhysicalBone3D Add methods, properties and signals that are present in RigidBody3D to PhysicalBone3D Oct 6, 2023
@mynameisgump
Copy link

I've also run into this issue trying to make a viscera cleanup detail styled game since I can't enable contact monitoring and get floor collisions on a bone to create a blood stain on the given collision points. There's plenty of other relevant threads/convos for the issue as well like godotengine/godot#25564, godotengine/godot#54198, or godotengine/godot#19002

I understand why you can't have PhysicalBone3D inherit RigidBody3D as stated in godotengine/godot#44150 (comment) but it would be really helpful to get some more of the functionality added from Rigidbody3d to them to allow for more complex usage.

@ruanrothmann
Copy link
Author

Looking at those past issues, it seems that functionality present in Rigidbody3D has steadily been added to PhysicalBone3D, we're just asking for the remaining few bits that are possible to be added as well.

Some of those issues have been addressed - you can definitely add impulses, add velocities etc. Combined with Jolt I've actually found PhysicalBone3D to be quite good to work with, I hope to have a little demo project out soon. For your use case you would have to look at collisions on the floor side of things as a workaround.

The other issue is that the body_entered signal does not return useful collision info, even for rigidbody vs rigidbody collisions, you have to monitor integrateforces for that which doesn't make sense to me. I think I might open a proposal for that, but overall it seems that work on Godot's physics side is in a bit of a limbo currently. I hope that Jolt gets adopted as the official engine (see #7308), I suppose it makes sense to make that decision first before making other changes.

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