Hi, just wondering what are you guy's thoughts on a minecraft style world featuring a lot of cubes via triangles meshes extracted from a volume. Currently, my setup is where I extract a triangle mesh, convert that into a BVHTriangleMesh for physic usage. This works for now, it runs decently without any sort of optimization, the only problem is memory usage. For a 320 x 320 x 256 terrain it's manageable, but I would like to have a little bit larger than that, say 512 x 512 x 256 and with that size it eats up a gig of ram.
So I'm wondering how to create a custom collision shape, or callback method, where Bullet let me handle collision for this custom shape. I would like it where I don't have to upload any mesh to Bullet. Where I could simply use my existing volume structure for collision queries as this would be very efficient, in terms of both memory and speed.
Thanks.
Custom collision shape for a Minecraft style world?
-
- Posts: 6
- Joined: Fri Feb 25, 2011 12:48 am
-
- Posts: 6
- Joined: Fri Feb 25, 2011 12:48 am
Re: Custom collision shape for a Minecraft style world?
Does anyone know how I can get shape sharing / instancing to work with CompoundShape. Basically I'm trying to instance cube shapes. Does that make sense? I create a single box shape, then I iterate over a volume (defined in local space), for each position (local space) in this volume that is an exposed to air, I add the instance box shape plus local position to the compound shape. I then use this compound shape to create a rigid body. This rigid body is set to be static.
It's not working though. Since I define each cube in local space, I figured I need to transform the rigid body into world space. It's not working as I expected.
Any suggestions?
It's not working though. Since I define each cube in local space, I figured I need to transform the rigid body into world space. It's not working as I expected.
Any suggestions?
-
- Posts: 6
- Joined: Fri Feb 25, 2011 12:48 am
Re: Custom collision shape for a Minecraft style world?
Oh my bad. I have a bug in how I'm defining exposed surface in order to instance a cube there. When I instance a cube for every voxel in the volume, it works fine.