I'm currently working on a voxel engine that loads terrain in 3D chunks, and I want to support separate "bodies" of voxel data. The only missing part of my implementation of this feature is the physics aspect (I just started integrating JBullet with my application with success thus far.) My questions are, in order of importance:
- Is it both supported and reasonably fast to have a physics object consisting of a dynamic rigid body, with multiple triangle meshes in a compound shape? Theoretically this is how my voxel bodies would be implemented. I particularly want angular momentum related functionality, but I've read this may be an issue. If this isn't really feasible, is there a better way?
- Would such an object be capable of swapping out meshes efficiently as they are loaded and LODed?
- This may be over-ambitious, but I'd like to support very large physics scenes, such that I might run out of floating-point precision. Is it feasible to "wrap" the physics scene by relativizing every object to a focal point that moves in large, fixed increments as the camera moves about? Any major considerations here? Is there a better approach?
- Would there be any problems giving individual voxel bodies their own gravitational pull? I assume I could implement this by manually applying forces to objects in a given range of any body. This might rely on bullet providing some method of querying boxes or sphere for nearby objects... just an ordinary collision query I suppose?