I have a terrrain that consists of 3D voxels. Those voxels are separated into 32³ chunks with their meshes constructed with the Marching Cubes algorithm.
I constructed each chunk’s physics with a RigidBody of 0 mass and thus their collisions shapes are of MeshCollisionShape.
I have many questions and problems related to all that :
When the red “punching bag” (that’s what we call it) falls with enough speed, it will clip through the surface and then fall inside the chunk itself. We found out that this does not happen if it falls onto a triangle. However, if it falls onto an edge or a corner of a triangle, then it will fall inside the chunk. My solution to that was to increase the accuracy (actually the accuracy is inverted and thus it is decreased…) by setting it to 1 / 240. This is really expensive so I was wondering if there was a better solution?
The player is actually the same as the punching bag model & physics and is moved with a BetterCharacterControl. Initializing the player and the chunks with the default friction makes the terrain unplayable, as movements will extremely often stops at an edge / corner of a triangle or will be like if something would slow non linearly the player’s movement. My solution to that was to set the player’s friction to 0, however this arises a new problem.
2.1) With a friction of 0, the player’s BetterCharacterControl slides in non-abrupt slopes… How can I fix both 2 and 2.1 problem?
In the Advanced Physics page, it is that MeshCollisionShapes do not work with dynamic spatials. What does that mean? Are RigidBodies with a mass greater than 0 dynamic spatials?
In the javadoc page of the PhysicsGhostObject class, it is said :
From Bullet manual:
GhostObject can keep track of all objects that are overlapping. By default, this overlap is based on the AABB. This is useful for creating a character controller, collision sensors/triggers, explosions etc.
So, to truly handle collisions with ghost objects that have CompoundCollisionShapes of HullCollisionShapes, what’s the best option? To filter the collision events to pick only those that are really colliding or to handle the collisions myself, eventually with an octree?