You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating system or device, Godot version, GPU Model and driver (if graphics related):
Godot engine 3.0 master 195b122
Issue description:
Cannot get direct space state for raycasting.. tried to do several method like World.GetDirectSpaceState() and PhysicsServer.SpaceGetDirectState(World.GetSpace()), but both return Null.
This is also happened with Physics2DDirectSpaceState.
Steps to reproduce:
Create a c# script, and paste this code:
World WorldRef = GetViewport().FindWorld();
GD.print(WorldRef.GetDirectSpaceState()); // Null
GD.print(PhysicsServer.SpaceGetDirectState(WorldRef.GetSpace())); // Null
The problem is that classes like PhysicsDirectSpaceStateSW are not registered manually. Instead, _post_initialize will register them when an instance is created. Bindings generators cannot detect many of these classes because of that.
I think the best solution would be the following:
Only the classes that are registered manually must be exposed to the bindings and to the class reference. Classes that are initialized on _post_initialize must be be registered in a special way so that bindings and class reference generators can differentiate them from the rest of the classes and ignore them.
When the engine wants to pass an instance of one of those special classes to C#, we need to create a managed instance that wraps it, and we do that by searching the class name via reflection. PhysicsDirectSpaceStateSW won't work. We need either get_class_name() or a new virtual method to return the name of the closest registered parent class (PhysicsDirectSpaceState in the case of PhysicsDirectSpaceStateSW).
Operating system or device, Godot version, GPU Model and driver (if graphics related):
Godot engine 3.0 master 195b122
Issue description:
Cannot get direct space state for raycasting.. tried to do several method like
World.GetDirectSpaceState()
andPhysicsServer.SpaceGetDirectState(World.GetSpace())
, but both return Null.This is also happened with Physics2DDirectSpaceState.
Steps to reproduce:
Create a c# script, and paste this code:
Console output:
Link to minimal example project:
The text was updated successfully, but these errors were encountered: