[Solved]Error: class <bullet.Point2PointConstraint> cannot be called

Hey everyone,

In the interest of contributing to the Physics Engine in Armory, I was trying to implement the Physics Constraints inside of Armory through Haxebullet. I started of with the simplest one: Point2PointConstraint.

Although it is currently implemented as a Generic6DOF constraint classbtGeneric6DofConstraint, I wanted to get it working as bullet.btPoint2PointConstraint:classbtPoint2PointConstraint

So, I followed the following documentation on how to go about it here:HaxeBullet

Both ammo.js and Bullet has its implementation.

Heres the snapshot of Point2PointConstrint in ammo.js/ammo.idl:

following the documentation, I added the following lines of code to Bt.hx

Then, I added the following lines to the PhysicsConstraint.hx
PhysicsConstraintHx

However, When I hit the run button, I get the following error on Blender Console:

    Armory\armsdk\armory\Sources/armory/trait/bullet/PhysicsConstraint.hx:108: Characters 13-44 : Class<bullet.Point2PointConstraint> cannot be called

I am relatively new to Haxe, So, Any help regarding this is appreciaed.

Thanks in advance.

I think you forgot the new keyword when creating the instance of the class, so fixed it would look like:

var c = new bullet.Bt.Point2PointConstraint(...
1 Like

That was it! So silly of me…

Got it fixed, Thanks!