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

body_test_motion not available in gdscript on PhysicsServer #20276

Closed
Tracked by #45333
rminderhoud opened this issue Jul 19, 2018 · 7 comments
Closed
Tracked by #45333

body_test_motion not available in gdscript on PhysicsServer #20276

rminderhoud opened this issue Jul 19, 2018 · 7 comments

Comments

@rminderhoud
Copy link
Contributor

Godot version:
master

Issue description:
body_test_motion() is available on Physics2DServer but not in the 3D server (PhysicsServer). It would be quite useful to have in 3D physics to implement custom physical motions.

@MrModez
Copy link

MrModez commented Oct 22, 2019

Can we please fix that? I don't think it's too much work :c

@notverymoe
Copy link

Just ran into this myself. I don't imagine this should be too difficult, would it be fine for me to take a crack at it?

@RevenantX
Copy link

you can use this https://docs.godotengine.org/en/3.2/classes/class_physicsdirectspacestate.html instead (and for some things this is better choice)

@notverymoe
Copy link

That's a significant amount of code required to work around an asymmetrically exposed method, imo, it'd be easier to just manually expose it unless you've got a need for some more unique work cases (which godotengine/godot-proposals#710 helps with in a lot of cases)

@Calinou
Copy link
Member

Calinou commented Jun 1, 2020

The way the source code is organized seems to make this nontrivial. PhysicsServer3D doesn't have body_test_motion, but PhysicsServer3DSW does. yet, we want to expose it in PhysicsServer3D to be consistent with 2D. Any ideas?

@notverymoe
Copy link

body_test_motion exists on PhysicsServer3D as a pure virtual method (line 494 in the header) implemented by both backends.

So, exposing it only requires the same setup as the 2D version, namely a wrapper around MotionResult, and a proxy method. Did have a crack at it before and got it working, but ran into some issues (segfault) with passing it certain Rigidbodies - which were, from memory, any non-kinematic bodies.

@pouleyKetchoupp
Copy link
Contributor

Closed by #50102 (4.0) & #50103 (3.4)

@pouleyKetchoupp pouleyKetchoupp added this to the 3.4 milestone Oct 6, 2021
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

7 participants