Best way to poke holes in terrain?
Posted: Fri Sep 19, 2014 12:46 am
I just started using BEPU terrains in my project, and recently I've been thinking of how best to poke holes in the terrain so that they can be fallen through, like if I want a cave in a mountainside, I can insert a cave model under the mountain and cut a hole in the terrain for the mouth.
My current way of achieving this is by putting NaNs in the height map where I want a hole to appear, which seems to work. This feels a bit hack-y though, and also seems like it depends on the "grain" of the terrain, because only triangles using that vertex are nulled out, so if one vertex is NaN-d, two opposite quads will be completely gone, and on the other two, the triangles furthest from the NaN will still be there. Preferably, I would like cutting out a vertex to uniformly remove all the adjacent quads, rather than it being dependent on the terrain's orientation + grain.
So my question is, is there a better way to do this? The only other way I could think of would be to subdivide the terrain around the desired holes, but though that's easy enough for one hole, adding more would make things increasingly complex.
My current way of achieving this is by putting NaNs in the height map where I want a hole to appear, which seems to work. This feels a bit hack-y though, and also seems like it depends on the "grain" of the terrain, because only triangles using that vertex are nulled out, so if one vertex is NaN-d, two opposite quads will be completely gone, and on the other two, the triangles furthest from the NaN will still be there. Preferably, I would like cutting out a vertex to uniformly remove all the adjacent quads, rather than it being dependent on the terrain's orientation + grain.
So my question is, is there a better way to do this? The only other way I could think of would be to subdivide the terrain around the desired holes, but though that's easy enough for one hole, adding more would make things increasingly complex.