Native bullet on Android with zero mass

I noticed that my game behaves differently on Android: I can walk through walls. This is because on Android the native bullet implementation is used. After switching the walls are massive again. What’s the recommended way to switch between these implementations? (I just modified the build file, but there might be a better way.)

My wall has no mass, but is kinematic. I know, that’s not recommended, but setting the mass to zero increased the performance significantly. So what should I do?

  1. Use non-native bullet? (I have to check the performance on some more Android devices, but it looks good.)
  2. Rework and set kinematic to false?
  3. Or set a mass and do some "simple" Minecraft like optimizations???

And how do I know such differences before testing?

Without seeing your code its neither possible to say why you can walk though walls nor why the result would be different in native bullet vs. jbullet (which performs abysmal on android and is hence not used on that platform).

There is not much code to see:

RigidBodyControl control = new RigidBodyControl(0f);
spatial.addControl(control);
control.setKinematic(true);

So the different behavior could also be a bug in native bullet? Mass zero and kinematic could be considered as “undefined”, so the different behavior is my fault / my own risk?

A RigidBody with mass=0 is static and should not be moved at all. Give it a mass and set it to kinematic or give it zero mass and don’t move it.

Well thanks for your patience. But I noticed that the performance is much better with a zero mass, so I could circumvent programming blockworld optimizations… and in my case it seemed to work… until now. :cry:

Well if just setting the mass to zero is increasing the performance and you don’t need to move the wall wheres the problem?

No, I have to move the wall. Thanks for your replies, but looks like my shortcut was a long way round…

Wherever the difference between jbullet and native bullet came from… it disappears after updating the native libraries!