Jump to content
  • entries
    941
  • comments
    5,894
  • views
    867,944

Vegetation Physics


Josh

2,689 views

 Share

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.

 

blogentry-1-0-39221600-1445450451_thumb.jpg

 

This allows us to simulate vegetation of any complexity without having to store each vegetation instance in memory.

  • Upvote 5
 Share

6 Comments


Recommended Comments

The location of each instance will be known right? I mean the instances will not be randomly placed on the terrain as the player walks through the map

Link to comment

The instances can be consistently retrieved according to the placement algorithm, but they are not stored in memory.

Link to comment

That is defined by the physics body dynamically. It encloses the entire volume the physics body occupies.

  • Upvote 1
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...