godot-nim
godot-nim copied to clipboard
Nim constructor not found for class BulletPhysicsDirectSpaceState
Using Bullet, on a Spatial object I'm trying to do a ray cast with PhysicsDirectSpaceState
var spaceState = self.getWorld().directSpaceState
The above generates an error from godotnim.nim
. asNimGodotObject
calls newNimGodotObject
with the name returned from godotinternal.nim#getClassNameRaw()
.
BulletPhysicsDirectSpaceState
is not part of the api.json.
This isn't the fault of godot-nim. The godot engine doesn't export it properly. The work around is modify godottypes.nim
with a new type and register the class.
BulletPhysicsDirectSpaceState* = ref object of PhysicsDirectSpaceState
...
registerClass(BulletPhysicsDirectSpaceState, "BulletPhysicsDirectSpaceState", true)
I've bugged this https://github.com/godotengine/godot/issues/48752 and created an engine PR to fix.
Yes, this basically duplicates #91. Thanks for submitting the PR to Godot.