Hi, I am wondering what methods could be used to keep my characters feet on the ground.
I only have one vertex buffer and one index buffer that stores the Area mesh. How would I go about keeping my characters feet on the ground?
I was thinking about raycasting downward from the character position and set the correct height, but that means I have to traverse all the triangles in the area for all the characters. I could store two copies of the area, one in system memory and one in device memory and use the first for rendering and the latter for raycasting.
I could also further divide the Area into sections and check which sections the character is in and only traverse those triangles during the ray casting. But then I have to think about optimizing how many sections, sub-sections and subsub-sections I need.
Am I thinking straight or is there a miracle simple and easy cure to this (i.e creating heigt map from the buffers, but this would comprimise accuracy right)?