ok so I’m working on minecraft in the bge and after deciding that using separate cubes as blocks was never going to work well, I decided to use a single mesh of cubes.
over the course of the past few hours I have learned how to interface with a meshes polygons and vertices in realtime, getting a polygon using raycast, change the uv coordinates of vertices, changing the position of vertices, etc…
what I’ve found is that moving a polygon doesn’t update the meshes’s collisions. Any ideas?
Let’s say you have big map with many chunks, if all chunks would have physics wouldn’t it lag like hell?
Okey, lets only have the physics enabled in the current active chunk…
But what about NPC or some bouncy projectile? There could be a npc in every chunk or jumping between chunks.
What i would suggest is :
Check the nearest 333 space for cubes:
Spawn invisible physics cubes inside the mesh’s fake cubes.
Do it “just in time” and keep the spawn rate and count in check (re-use cubes and delete obsolete ones).
It really defeats the point in disabling physics, because raycasts still use the physics engine, as do dynamics. It will ultimately be faster to use the built in collision system, as raycasts test the entire physics world (will culling) every call.