Using PhysX, how can I predict where I will need to generate procedural terrain collision shapes?
Posted
by
Sion Sheevok
on Game Development
See other posts from Game Development
or by Sion Sheevok
Published on 2014-01-20T03:06:02Z
Indexed on
2014/08/20
10:35 UTC
Read the original article
Hit count: 186
In this situation, I have terrain height values I generate procedurally. For rendering, I use the camera's position to generate an appropriate sized height map. For collision, however, I need to have height fields generated in areas where objects may intersect.
My current potential solution, which may be naive, is to iterate over all "awake" physics actors, use their bounds/extents and velocities to generate spheres in which they may reside after a physics update, then generate height values for ranges encompassing clustered groups of actors. Much of that data is likely already calculated by PhysX already, however.
Is there some API, maybe a set of queries, even callbacks from the spatial system, that I could use to predict where terrain height values will be needed?
© Game Development or respective owner