armory3d / haxebullet

Bullet 3D Physics for Haxe
http://bulletphysics.org
zlib License
94 stars 21 forks source link

'btRigidBody': no appropriate default constructor available #20

Closed Sondro closed 6 years ago

Sondro commented 6 years ago

Hi, in the cpp build I'm still getting "error C2512: 'btRigidBody': no appropriate default constructor available" (which is a repeated problem with other files, ie btDiscreteDynamicsWorld).

I tried this type of construction, but not really sure what to do at this point : https://github.com/armory3d/haxebullet/issues/19

Sondro commented 6 years ago

So after talking to the guys at #kha apparently I need btRigidBody:btRigidBodyPointer = create()... OR remove the type and have it auto assigned, ie btRigidBody = create()...;

cpp still not quite compiling because of some render issue, but I'll leave this open for a little while in case there is something else you want to add.

luboslenco commented 6 years ago

Sorry I did not get to this sooner.

Robert hooked up a Bullet example recently: https://github.com/Kha-Samples/BulletTest

Cpp compilation fix by removing the type: https://github.com/Kha-Samples/BulletTest/commit/fd6df9fde8a80eb7d55af348c5ff305e019e16f2

Or using the predefined BtThingyPointer typedefs, on cpp those ends up as cpp.Star<> types: https://github.com/armory3d/haxebullet/blob/master/Sources/haxebullet/Bullet.hx#L1836

Sondro commented 6 years ago

Thanks, much appreciated.

Do you know whether the BtPointers would be more or less performant?

luboslenco commented 6 years ago

No perf difference - BtPointer typedefs allow to write the same code for both js/hxcpp (as on cpp it wraps the types into cpp.Star<>).