Native bullet bug fix

If I knew off the top of my head I would have told you ^^

You get a wrong how to use pointer of C++.

It can’t solve by compiler option.

Your code does not work on win64.

I fixed that and compiled by VisualStudio10 for win64.

Now, it works.

Vehicle is now fixed in the jme3 svn as well.

It does not fix yet.

You delete reference.

Your code is wrong.

Of what? The WheelInfo? No I don’t. The finalize_native is never called.

You are probably right about the casts though, if this also makes it work for windows64 all the better, I changed the jme3 version to use the reinterpret_cast as well, thanks.

(Sorry.I see this bug was fixed.)

Sorry, you fixed that bug.

The problems to be left that I already fixed is pointer problems.


btMotionState* motionState = (btMotionState*)motionstatId;

btMotionState* motionState = reinterpret_cast<btMotionState*>(motionstatId);


This change is not necessary. However, it is strongly recommended for 32bit platforms because it causes many compiler warnings.

The warnings can’t remove by compier options.


return (long)body;

return reinterpret_cast<jlong>(body);


This change is necessary for win64 platform because pointer is 64bit but long is 32bit on win64 platform.

The problems that I don’t yet fix are:

VehicleWheel#getGroundObject doesn’t implemented yet.

TestRagdollCharacter doesn’t work.

TestHoveringTank works, but little strange.

TestAttachGhostObject works, but different from jbullet.

As I told you, the method you try to “fix” is never being called.

By the way for somebody who is easily offended himself you sound pretty offensive. And despite the fact that you heard “thank you” and “good job” often in this thread you never said something like “you’re welcome”… :confused:

I’m sorry I am weak in English.

I apologize about there having been rudeness.

I am sorry.

And thank you.

1 Like

chototsu VS normen :D.

No I think we’re good, we both want some physics in our games :slight_smile:

1 Like

a) As I said, I now use reinterpret_cast everywhere where its necessary. All remaining casts are normal internal C++ casts.

b) getGroundObject is broken in native bullet itself, if you want to fix that give it to them not us

c) Might have to do with an issue when adding kinematic objects to the physics space (see test class for that)

d) TestHoveringTank occasionally has issues in the jbullet version too funnily

e) The collision flag of the ghost objects is still not right after your changes. Effectively ghost vs ghost collides now

Wow, great job around native physics is being done around here =]