Closed samanthabeilman closed 2 months ago
Abstract classes can't be extended from GDExtension. So, even if godot-cpp were modified to avoid the compiler error you're getting, unfortunately, it wouldn't work from the Godot side.
Understood! Thank you for the confirmation. I very much appreciate your time!
Godot version
4.2
godot-cpp version
4.2
System information
Windows 11
Issue description
Hello!
I am a student and am trying to extend the PhysicsBody3D class as part of a learning exercise.
Early warning (so that nobody wastes too much time) that this may be a duplicate of: https://github.com/godotengine/godot/pull/67510 && https://github.com/godotengine/godot-cpp/issues/873.
I think that the problem may stem from the godot-cpp bindings not exposing the constructor for PhysicsBody3D. If this is intentional because it is an abstract class and is not allowed to be extended, then feel free to close this issue without responding (I truly don't want to waste your time).
When I use an empty constructor for PhysicsBody3D, the code will compile but the derived class is not available in the editor. (It says "Cannot get class 'PoolBall'. "). When I try to use the constructor with a PhysicsServer3D::BodyMode parameter, it will not compile, but I believe that that is the correct constructor to use (from reading the source code: https://github.com/godotengine/godot/blob/4.2/scene/3d/physics_body_3d.cpp#L55).
The following errors are produced when doing so:
Apologies if the issue is due to my lack of understanding, and thank you for your time. :)
For your convenience, this is the godot-cpp\gen\include\godot_cpp\classes\physics_body3d.hpp:
(Edit: typo)
Steps to reproduce
Minimal reproduction project
Header file
C++ file