mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 10:13:22 +02:00
Handle case in entity loading priority function where max dim size is <= 0
This commit is contained in:
parent
2a071c4329
commit
fb14628a7e
1 changed files with 5 additions and 0 deletions
|
@ -3250,6 +3250,11 @@ void Application::init() {
|
|||
getEntities()->setEntityLoadingPriorityFunction([this](const EntityItem& item) {
|
||||
auto dims = item.getDimensions();
|
||||
auto maxSize = glm::max(dims.x, dims.y, dims.z);
|
||||
|
||||
if (maxSize <= 0.0f) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
auto distance = glm::distance(getMyAvatar()->getPosition(), item.getPosition());
|
||||
return atan2(maxSize, distance);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue