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

Expose registration of physics servers to GDExtension #65427

Merged

Conversation

rburing
Copy link
Member

@rburing rburing commented Sep 6, 2022

This exposes PhysicsServer2DManager and PhysicsServer3DManager with a minimalist API that can be used by GDExtensions:

physicsserver2dmanager

Note that the Callable can be conveniently created in engine/module code by using callable_mp_static (as can be seen in this PR). This convenience unfortunately does not seem to extend to GDExtension (so far). On the GDExtension side a Callable must currently apparently be created from a bound method.

Small test project: PhysicsServer2DExtension_test.zip

@rburing rburing force-pushed the register_custom_physics_server branch from a1707e4 to ccd6eb6 Compare September 6, 2022 16:36
@rburing rburing marked this pull request as ready for review September 6, 2022 16:38
@rburing rburing requested review from a team as code owners September 6, 2022 16:38
@rburing rburing marked this pull request as draft September 6, 2022 22:38
@rburing
Copy link
Member Author

rburing commented Sep 6, 2022

There is currently a segmentation fault on shutdown (when using a physics server from a GDExtension) because GDExtensions are deinitialized before physics is finalized, found by @derammo. Will think about the proper fix and push it soon.

This exposes PhysicsServer2DManager and PhysicsServer3DManager.
@rburing rburing force-pushed the register_custom_physics_server branch from ccd6eb6 to 532e378 Compare September 7, 2022 13:48
@rburing rburing marked this pull request as ready for review September 7, 2022 13:49
@akien-mga akien-mga merged commit bd49129 into godotengine:master Sep 7, 2022
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga added this to the 4.0 milestone Sep 7, 2022
@rburing rburing deleted the register_custom_physics_server branch September 7, 2022 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants