Running into a problem and hoping you could help :D:
My vehicles go through walls on my android version of my lil game.
Doesn’t happen when I run the same code on desktop windows 64.
Developed, built and run using the sdk and jMonkeyEngine 3.0.10.
Target android: Samsung G3 I8190 mini using android 4.1.2.
On my side, the only change when running that version on android is a different input listener. A part from one initialization process run once that can’t have an influence here.
smaller circuit triangles
playing with CcdMotionThreshold (and the sphere method)
tried making a bigger collision shape for the hull of the vehicles
Basically, the wheels stay on the track fine, but whenever the hull collides, it just goes through and the wheels follow through.
Doesn’t require a big speed or a big torque, low fps or anything such.
I don’t see any errors in the logs.
At this point, all I can think of is an appState checking distances to determine when a vehicle is out of the circuit, making a boom and putting it back on pretending nothing happened :D. But it really doesn’t fit my agenda.
Any idea? Is the bullet used by android doing something special I should know of? I suspect accuracy changed might not be taken into account, but this is deeper than that.
Any information would be great (such as what bullet is used etc), because I’m pretty out of solutions.
@ - Empire_Phoenix
I don’t move the circuit. It is procedurally built where I want it.
Some parts have long triangles, but it fails in the curbs and when meeting obstacles, and those are made of small triangles.
I use a BoxCollisionShape for better performances. I would use it without a CompoundCollisionShape but using that CompoundCollisionShape is the only way I found (well copy pasted from the tutorial :D) to move the collision shape upwards.
@ - normen:
I tried with that method and have the same results. You might have been pointing to that and I missed it.
Tried collisions with a simple RigidBodyControl (no vehicleControl) and it then works fine with a BoxCollisionShapeand and a CompoundCollisionShape.
I also gave impulses following touchs to those boxes and it worked fine (box was blocked by walls).
Grumpf, this is an elusive problem :D.
Tried an even bigger CollisionShape to no result, still, at 1/20th of the speed it goes on fine with desktop, it doesn’t bump on a vertical wall, it goes through it and ends up flying in space.
To me it seems that the wheels work fine but the hull collision shape is messed up when using a vehicleControl.
I’m very sorry for having wasted you peeps time… I’m a friggin idiot! And it’s genetic, not behavioural… was really careful, but seems at some point I removed a call to setCollisionGroup and setCollideWithGroups. I’ve checked that multiple times but seems I checked it moronically.
As I was told, jBullet can be more forgiving, and probably by defaults makes all objects collide while bullet doesn’t and that’s why the problem only occurred under android.
It now works… thx to all that gave ideas, and very sorry for wasting your time.
Actually the bullet version does that check (collision group vs collide with group) wrong, it was contributed at some point and I didn’t get to fix it yet. But it would have helped to know that you use it at all
I don’t know what to say haha… I really checked it because it was an obvious potential culprit… would be nice to have some brain unit tests to check it’s working correctly before using it to check assumptions XD.
Anyway, it’s working now perfectly and I’m dancing in circles giggling like an old fool.