Vegetation Physics
I just had a breakthrough with the physics. There's a lot of optimization work left to do, but I can see at this point the idea works.
Newton Game Dynamics provides a mechanism for a user-defined collision shape. This accepts a bounding box and calls a user-defined callback any time an object intersects the bounding box. The callback builds a mesh dynamically for the area that the other object occupies. Internally, Newton uses this mechanism to process heightmap terrain without having to store a triangle mesh for the entire terrain geometry. It can also be used for things like dynamically calculated voxel physics.
In our case, we are using this to build a mesh for the relevant instances around the colliding object. In the image below, the car has an AABB around its extents, and this AABB is used to retrieve all relevant instances within that volume. The mesh is constructed and sent back to Newton for processing collisions.
This allows us to simulate vegetation of any complexity without having to store each vegetation instance in memory.
- 5
6 Comments
Recommended Comments