Graphics disappear when BetterCharacterControl collides with newly created MeshCollisionShape

Hello,

I am developing a voxel engine, here is a video that shows the bug: Dropbox - Error
This only happens when the character collides with a chunk that has just been recreated.

That’s how I create the CollisionShape of the chunks and the Character:

  • chunkRigidBodyControl.setCollisionShape(CollisionShapeFactory.createMeshShape(optimizedChunkSpatial));
  • new BetterCharacterControl(.3f, 1.9f, 80f);

I also have this other problem: Dropbox - Error

Anyone can help me with this?

I guess its rather an issue of your mesh not updating its bounding volume than collision related. Physics doesn’t have anything to do with the render/mesh side.

I call “updateBound()” on all my meshs after setting their VertexBuffers.
I can’t locate the problem because there is no error messages…

Ok I fix the first bug by instantiate a new RigidBodyControl for each chunk refresh.
If I don’t do that and only “setCollisionShape(newMeshShape)”, in some cases the collisions have strange effects.
The graphics was not disappearing but somehow the camera location was set to Vector3f.NAN

But my character still get stuck in or get trough the ground when he hit it with a high velocity. Any ideas why? Is this normal?

Thanks

Yeah thats normal.