Collisions and fluid simulators

0
paulstraw posted this 29 March 2017

Hey all!

I just picked up PicaVoxel, and I'm loving it so far. I was curious if anyone has had luck integrating PicaVoxel's collision meshes with something like Fluvio or another fluid sim. I tried getting this set up, but it seems like I'd have to manually generate a new mesh with the contents of each chunk, and then keep that up to date myself. I might be missing something super obvious, so I'd love to hear if anyone has had success with this sort of thing in the past.

Thanks!
-paul

3 Comments
Order By: Standard | Newest | Votes
0
GarethIW posted this 29 March 2017

Hi there,

I'm not familiar with Fluvio (or similar) - what are the requirements for mesh colliders that it can work with?

0
paulstraw posted this 29 March 2017

GarethIW: Basically what's going on is that the Fluvio Fluid Collider requires a BoxCollider, CapsuleCollider, CharacterController, MeshCollider, SphereCollider, TerrainCollider, or WheelCollider on the GameObject you assign it to. As far as I understand, that means I would have to either attach a new Fluid Collider to each chunk's mesh, or generate a mesh representing all chunks as described above. Thanks for your help. 👍

Last edited 29 March 2017

0
GarethIW posted this 29 March 2017

It seems pretty limiting that the fluid sim can only run against one collider. When it comes to mesh colliders, Unity itself is also pretty limiting. Convex mesh colliders can only have a maximum of 255 polygons. Concave colliders go up to 65536 vertices, but there are limits to the type of colliders that can collide with concave mesh colliders.

The vertex limit on meshes is one of the reasons that PicaVoxel splits up large voxel volumes into chunks.

I would start by testing Fluvio + PicaVoxel by using a small volume of 16x16x16 or fewer voxels. This will mean that only one chunk is used. Test it using Concave and Convex collider modes. Make sure it works before going further down the rabbithole.

If that works, you can play about with the Chunk Size to see if you can fit the voxels you need into one chunk. The chunk size is x*y*z, and doesn't have to be uniform - so a 64*64*1 chunk size is valid for example.

But at the end of the day, if you want to use larger or more complex voxel volumes and Fluvio really is limited to a single collider, then yes - you will need to figure out a way of creating a mesh collider that covers the surface of the entire volume without splitting it up into chunks or exceeding the vertex/polygon limit. If you want to do that and still be able to destruct the PicaVoxel volume at runtime, it'll be a tough ask.

Last edited 29 March 2017


Our 282 members have posted 390 times in 91 discussions