How do I change the collision Data of certain a Point (or a Triangle) in a Mesh without recalculating the whole collisionTree(?)?
I have a large static custom Mesh and I want to touch and move only 1 point at a time but recalculating the whole Collision data after every action takes a lot of time and the game start lagging when I do it so I thought it might be faster to only change/recalculate the data of the point that im modifying.
The problem seems to happen in BIHTree but there is no documentation at all in BIHTree and Wikipedia (Bounding interval hierarchy) doesnt help explaning what is going on and now Iām a little bit lost. Can someone help me or point me in the right direction?
As normen says, you canāt⦠because changing one point may cause the whole tree, or certainly large parts of it, to change. Itās a less extreme example of something like trying to edit a byte in a zipped file⦠ultimately you have to unzip and rezip it.
Your real solution is going to be not having a ālarge static custom Meshā but āseveral smaller custom meshesā⦠though note itās tough to call a mesh āstaticā when you have desires on changing it.
Your real solution is going to be not having a "large static custom Mesh" but "several smaller custom meshes"... though note it's tough to call a mesh 'static' when you have desires on changing it. ;)
I tested this and the more objects I put on the scene the more the framerats drops. Its shifting the problem from a momentary ābigā problem to many constant small problems. but I guess its still not the best implementation.
The Mesh is āstaticā in a way that only the y coordinate is modified (x and z are constant), I cant take a terrain implementation because I modify the index buffer on how the mesh is drawn.
@drollian said:
I tested this and the more objects I put on the scene the more the framerats drops. Its shifting the problem from a momentary "big" problem to many constant small problems. but I guess its still not the best implementation.
The Mesh is āstaticā in a way that only the y coordinate is modified (x and z are constant), I cant take a terrain implementation because I modify the index buffer on how the mesh is drawn.
There is bound to be a trade off between size and number of objects. The other thing that more objects gets you is better culling, also⦠though you probably arenāt vertex limited anyway. Unknown since we donāt know what ālargeā is in this case.
Anyway, BVH is not the most efficient way to do collisions with a heightmap anyway so you are better off implementing your own.