-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Fix Bullet Physics Server #47508
Fix Bullet Physics Server #47508
Conversation
IIRC the plan was to have support for pluggable physics engines via GDNative, so integrating more physics engines into core likely is not desired. |
Does not matter. Then I deliver it as a gd native module. I am currently at around 75% and I will be finished by the end of the week and will start the first tests. But I think that in the long term bullet should be replaced anyway. |
@sboronczyk It does matter, because even if a feature is fully 100% implemented and working, it may not actually be desired to be merged into the engine. In general, if a big feature hasn't been approved by a core maintainer, a PR for it will be ignored. |
Okay. Not important to me though. I need PhysiX for my purposes and of course I like to share it with the community (whether it will be delivered as a core module or as a GDNative module is another question). If a core mantainer thinks it makes sense, that would of course be so much the better. But back to the topic :-) Thats PR is only for the bullet physics. We can talk about it further via discord. greetings sj |
But it can still be tested and evaluated and used by people and thus gain useful insights for a better implementation down the road. |
Thank you guys for your different opinions. But we should keep the PR free for important questions about the request and not talk about other PRs or projects. I think that's just confusing :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this! The plan is to move Bullet to a separate plugin, but in the meantime it's good to have it working again, and these changes would be needed anyway.
I haven't tested yet. For info, you can use this test suite to check for regression and test with multi-threaded configuration:
https://github.com/godotengine/godot-demo-projects/tree/master/3d/physics_tests
Okai tomorrow i will start to check and round the pr up. |
You mention "Bullet3", but I don't see any changes to the Once this is ready, please remember to squash the commits into one, as the history of whitespace fixes in PRs is not relevant to the engine's Git history. |
sorry my mistake. of course it's bullet 2 (I assumed that godot is already using bullet3). but i can extend it to bullet 3 (but guess that will cause more problems than fix). I therefore recommend changing the whole thing to bullet 3 when bullet is delivered as a native plugin. your decision! |
@sboron There's no plan to update Bullet. I've updated the PR title to reflect more accurately what it does. |
Okai sorry for the misscommunication. |
I compressed all commits into one and adjusted the commit name. Changes are included (except for the unresolved ones). |
fix whitespaces :-) Remove whitespaces Fix whitespaces fix whitespaces space_bullet.h cleanup cleanup Add bullet2 to godot4 fix wrong line
Nitpick but I'd suggest using "Fix and re-enable Bullet physics for 4.0" instead of "Add bullet 2 physics to godot 4". The latter sounds like you're adding a full blown implementation of bullet2 for Godot, which we've already had since Godot 3.0, but it was disabled a couple of months ago during API changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've stopped reviewing when I've found again some conversations marked as resolved without the comments being addressed.
I'm not going to spend extra time reviewing the same things over and over again, so you need to stop doing that. Make sure you address all the comments that were made before, including conversations you've closed, and answer to them if you don't agree, and then you can request another review.
Edit: The general idea behind lots of my comments is, this PR is meant to make the Bullet server work again, but it doesn't need to entirely match headers from Godot Physics when not needed. Each server implementation has some specific variations, and it's not needed to copy all methods and members over just for the sake of making things identical.
for (int i = overlappingObjects.size() - 1; 0 <= i; --i) { | ||
overlappingObjects[i].object->on_exit_area(this); | ||
overlappingObjects.write[i].object->on_exit_area(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.write
doesn't seem to be needed here and is going to cause unnecessary copies.
@@ -139,6 +140,9 @@ class AreaBullet : public RigidCollisionObjectBullet { | |||
_FORCE_INLINE_ void set_spOv_priority(int p_priority) { spOv_priority = p_priority; } | |||
_FORCE_INLINE_ int get_spOv_priority() { return spOv_priority; } | |||
|
|||
_FORCE_INLINE_ void set_priority(int p_priority) { priority = p_priority; } | |||
_FORCE_INLINE_ int get_priority() const { return priority; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods and the priority
member are not needed, they are not used anywhere.
BulletPhysicsServer3D::BulletPhysicsServer3D(bool p_using_threads) { | ||
using_threads = p_using_threads; | ||
active = true; | ||
doing_sync = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
active
and doing_sync
are already initialized in the header, they don't need to be set here.
mutable RID_PtrOwner<RigidBodyBullet> rigid_body_owner; | ||
mutable RID_PtrOwner<SoftBodyBullet> soft_body_owner; | ||
mutable RID_PtrOwner<JointBullet> joint_owner; | ||
Set<SpaceBullet *> active_spaces; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was marked as resolved, but wasn't addressed.
Sorry to bump on it, is there any way to help unlock this PR? I have tried this branch and except some conflict because of some API changes (Transform -> Transform3D, PhysicsServer3D::MODE_DYNAMIC_LOCKED -> PhysicsServer3D::BODY_MODE_DYNAMIC_LOCKED...) Just got a crash on the editor side that is easy to fix, but otherwise, the main features are mostly back (need to check the constraints maybe). |
Bullet2 physics compatibility for to new rendering server api in godot 4. Only small changes were necessary.
Next step: PhysX Integration (in progress)