Implement get_applied_force and get_applied_torque for 3D joints#111842
Implement get_applied_force and get_applied_torque for 3D joints#111842brainfoolong wants to merge 8 commits into
get_applied_force and get_applied_torque for 3D joints#111842Conversation
get_applied_force and get_applied_torque for 3D joints
|
Hey there! Do you have an MRP & test builds as well so we can test this in action? |
Hey, please give me some advice what this exactly is (MRP) and how i can provide that data? |
It's a small, minimal project which will allow us to test your features. You can just make a |
This comment was marked as resolved.
This comment was marked as resolved.
Allright, i will create some. What build should i integrate, is a windows build
Thanks, the reference is already added. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Thank you realized my message had a typo it should have said to link to the proposal in the PR, don't know how that got in threre! |
Just provide the MRP instead! |
|
Please don't upload any builds, they can be gotten from the CI build or built manually, people shouldn't run unknown executables uploaded to GitHub |
How can I get them from the CI? |
|
They're listed as artifacts, see here |
|
Thx for all feedback. MRP is added -> physics3d_joints_mrp.zip |
swpr.mp4This is the showcase of this PR. It looks nice :) (Sorry for the lag, may be because I have many apps open) |
|
I've looked into the 2 failing checks, but i am not quite sure about both: https://github.com/godotengine/godot/actions/runs/18650008833/job/53166436589?pr=111842 https://github.com/godotengine/godot/actions/runs/18650008833/job/53166436573?pr=111842 |
|
The methods should be sorted yes, please see here The second issue is that you are not matching the return types, they're changed from |
Allright, i've changed it that way. |
|
Ups, i'm not sure if i messed up this PR. I accidentally synced master into this PR. May this be a problem? |
|
Didn't cause any problems this time it seems but prefer to rebase instead, you can remove that merge commit using: Make sure to pull your branch to your local version first to make sure you drop the merge commit though |
70d5e17 to
34756da
Compare
|
@AThousandShips Thanks, seems it worked. |
|
Is there any possibility that this get merged? The longer it takes, the lower the possibility that this can be merged without problems, i guess? |
|
Right now we're in feature freeze for 4.6 so new features and enhancements won't be merged until after that has been released (scheduled for January) |
|
Hey, I am unsure if this should be a new issue or what, but the error
is being given when node_a and node_b is empty while trying to get applied forces. |
As far as i understand the jolt things, this is how it is supposed to throw errors when some data is missing. The code should run properly however, it just return 0.0 and log that error. This errors appear in other jolt functions as well. I've implemented the error checks the same way. |
|
Would it be possible to change the functions to return a vector3 version of the force/torque, instead of the magnitude? I need it to make a breakable joint that only breaks in specific direction. |
Not with Jolt. Jolt exposes this as it is now. It's not a problem of this PR, it exposes all this as it is originally from the physics engine. You may have to go to the jolt library to suggest it there, but i don't think that this is a thing that can be changed without rewriting the whole engine. |
|
It looks like jolt already exposed it. It is just that godot is the one that exposed it as a magnetude: If the method is not used anywhere, should we just change it to return the vector3 force instead? 🤔 |
Ah, i see, you are right. Interesting. Well, that shifts the problem to godot, but still not for this PR. To keep it on-topic, you should create a new Feature request about that. |
|
If I remember correctly: The reason that only the magnitude was exposed is that these quantities are in constraint space and there currently isn't a way to know what that is in Godot. |
Can it be returned in world space instead? |
You can, but it gives you a dilemma:
|
|
I will close this PR at the end of may 2026. My spare time shifted and a cannot provide any more support for this PR. Hope someone can bring life to this or close it right away, i'm fine with both. Greetz |
|
I don't think there's any issues with merging this currently, at least there aren't any merge conflicts, and it's unlikely that it's become so out of date in so short a time This is unlikely to be merged before the end of the month as 4.7 is likely to release no earlier than the end of the month, though this could get in early 4.8 if it is ready |
|
Would you combine all the commits into one? EDIT: also, I think the generic 6dof methods should be placed just above |
Hey there!
Since Jolt is directly implemented and Jolt has a lot of features and improvements over default physics, the goal of Godot seems now to integrate Jolt more tightly with Godot and make it a complete replacement long term.
One thing i really miss is the control of joints and how to correctly measure them, so i am able to break them when i decide to do so.
Fortunetely, Jolt already have 2 convenient methods to play with:
get_applied_forceandget_applied_torquedirectly on a joint.All what was missing is the bridge/expose to Godot and GDScript, which this PR does integrate.
I tried my best to follow all the rules that i've found for godot core development, please review and give feedback on whatever you decide.
My C++ knowledge is a bit rusty and also this is my first time fiddling with the godot engine core.
Hope this helps you out. Would love to see it merged, i for now work my own fork until this (or anything similar) gets merged into master.
I've not found any tests for physics what so ever, so i not have written tests for it.
Documentation (Xmls) however should be updated properly, Warnings are emitted if the feature is not supported (When on default physics).
Proposal: godotengine/godot-proposals#13422
MRP: physics3d_joints_mrp.zip