My friends and I are having some trouble with PlaneCollisionShape. We’re using it as the collision shape for the “ground” in our game, as it is perfectly flat, and we want it to stretch on no matter how far you may walk. The problem is, the mere existence of a PlaneCollisionShape appears to cause collision listeners to ALWAYS fire EVERY tick, even when no collisions are occurring.
We have a hacky workaround in place right now, using a perfectly flat HeightfieldCollisionShape, which does not exhibit this behavior. But ultimately, we need to use PlaneCollisionShape so that there is no arbitrary limit to the world’s surface area before you just “fall off.”
Here is our Ground object, with the PlaneCollisionShape currently commented out with our workaround in place:
Can you make a testcase for this problem? As soon as I implement collision listeners in native bullet I can check if this is a jbullet issue or if its in the norma bullet too.
Upon running it you should see a cyan box, falling towards a flat yellow quad. The quad is there to show you where the PlaneCollisionShape is, exactly. What you should not see is a magenta box, hovering in the air at the same level that the cyan box spawns. The expected behavior is for the magenta box to only show up after the cyan box smashes into the yellow quad. However, the magenta box appears immediately… because the existence of a PlaneCollisionShape in the physics space causes collision events to fire every tick. If you change the collision shape for the yellow quad to be something else, like a BoxCollisionShape, it behaves as expected. If you comment out the line that adds planePhysics to the physics space, it also behaves as expected: the magenta box doesn’t appear, and the cyan box falls through the quad