How to detect avatar is on the ground?

I wonder if some of us could work on a collision system (non-physics) that could cut up a massive scene, like a city, into small chunks and then do collisions with them. Really I wouldn’t go with the scene-centric angle, and instead would just make some sort of fancy data structure to which stuff is added in chucnks, but that may just be semantics. The octrees that are already available might work, I’m not sure. One issue though is that the meshes we put in these games aren’t really ready to be put into an octree in a meaningful way (or at least I don’t know how to do it). And by meaningful, I mean that the collision would have to be orders of magnitude faster. Just shoving a mesh of 3 story building into an octree doesn’t result in being able to walk on the floors or walk into walls without a ton of excess checks (it needs cut up first). Likeswise making a 3 story building out of 300 meshes will give us lots of little pieces to shove into a spatial structure that could do collisions efficiently (maybe), but is going to blow through the rendering budget.

I just made a multiplayer first person shooter and I’m pretty new to 3d, so I made a voxel system b/c i don’t know enough math to do anything else. I had a pre-existing networking engine that could do high player counts, and really I just wanted something to show off in 3D. The chunked voxel allowed the map to be really big (practically infinite), and there could be 50 players and hundreds of items falling on the ground without getting beyond 2% cpu worth of collisions. The voxel collisions are really cheap, b/c one can just divide the position of any object by the size of the voxels and we know what voxel it is in. No actual triangle-intersects-triangle type of math needed. The visible world is just a few meshes (1-9, depending on my world size). So this covered the two major performance problems that were in the way (fast collisions, small number of rendered meshes). But hey it’s voxels…

What I’d really want is similar performance on a world made out of arbitrary imported or generated meshes like terrain and buildings. I have no idea if some sort of general purpose solution is possible that could be shared among babylon users, or if anything that achieves this level of performance is pretty much married to the game it was made for (like the voxel thing). But I do totally plan on taking a deep R&D dive into this before the next game (~3-6 mo). Maybe we could start a thread prototyping techniques…

1 Like