Jump to content

max distance seems to use a bounding sphere test--how to change it to bounding box?


photo

Recommended Posts

Hi, I'm setting rectangular objects with very small max visibility distances, and they seem to come in to view when approaching a point in space, rather than closet point of the rectangle.  Do all meshes have bounding spheres and bounding boxes?  How can I force it to use only the bounding box, if this will solve my problem such that when i approach any part of the rectangular object, (wall), it comes into view, not just the center of the wall?

 

Thanks.

 

I'm calling:

mesh->setMaxVisibleDistance((float)meshParams[MeshParamsEnum::MP_MAX_DISTANCE], i);
mesh->setMaxFadeDistance((float)meshParams[MeshParamsEnum::MP_FADE_MAX_DISTANCE], i);
Link to comment

Here is an example.  When you approach the long cuboid object from the center of it, it appears way sooner than 0.25 meters.  When you approach it from the end it appears at the correct time.  The only thing I can figure is it's using a bounding sphere test to determine when to show it as visible, rather than a bounding box test.

 

Suggestions?

unigine_project_max_vis.cpp

unigine_project_max_vis.world

Link to comment

Hi Robert,

 

You've figured right, Unigine uses bounding sphere when it calculates a distance to an object.

And no, you can't affect this behavior via API.

Actually, if there were a way to use bounding boxes, it wouldn't help either as bounding boxes are axis-aligned in Unigine.

 

I'm afraid I have no other ideas except writing custom code for it. :(

Link to comment
×
×
  • Create New...