Jump to content

Level of detail when getting intersects


photo

Recommended Posts

In my company's application we have a vehicle driving through a fairly large world, for performance reasons we've set the lod_threshold of the terrain to 1 meter. We use a 3rd party physics engine to determine where the vehicle drives. To calculate at what height the vehicle is driving, we get the intersection between the world and a vertical hypothetical line using "Unigine::World::get()->getIntersection" (e.g.: when the vehicle is at point x.y, we get the intersection between -100 and +100 meters at point x.y) and then use the z-value of this intersection to determine where we draw our vehicle.

It seems however, that the "getIntersection" method we use ignores the threshold and returns the value at full resolution (about 0.1 meter). This means that our vehicle will occasionally get stuck in an "invisible" hole (as in the hole is on the full resolution map, but the lod_threshold prevents you from seeing it).

Is it possible to setup Unigine that "getIntersection" uses the same resolution as the lod_threshold (i.e.: I want "getIntersection" to return the value I see on screen and not the value in the original source).

Any help is appriciated,

Thanks.

Link to comment

Hello!

Right now I think the "working" solution will be to:

  1. Export terrain data as .mesh
  2. Open that .mesh via UnigineImport plugin in 3ds Max / Maya
  3. Manually simplify geometry (for better intersection performance)
  4. Setup collision / intersection masks for objects so car will not use the terrain for that
  5. Import mesh from step 1 and align with terrain
  6. Use that mesh for intersection (setup collision / intersection masks)

That approach will allow you to control visuals / performance level (but only manually by editing the mesh). Probably you can left mesh only on the area where car will actually be, not the whole area.

Thanks!

 

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...