robert.blodgett Posted March 16, 2017 Share Posted March 16, 2017 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
silent Posted March 17, 2017 Share Posted March 17, 2017 Hi Robert, Could you please provide some small test scene where we can see that behavior? In that case we can give you the best advice :)Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
robert.blodgett Posted March 20, 2017 Author Share Posted March 20, 2017 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
ded Posted March 22, 2017 Share Posted March 22, 2017 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
Recommended Posts