pragmagic / godot-nim

Nim bindings for Godot Engine
https://pragmagic.github.io/godot-nim/
Other
497 stars 27 forks source link

Nim constructor not found for class BulletPhysicsDirectSpaceState #102

Open geekrelief opened 3 years ago

geekrelief commented 3 years ago

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.

endragor commented 3 years ago

Yes, this basically duplicates #91. Thanks for submitting the PR to Godot.