Handle case in entity loading priority function where max dim size is <= 0

This commit is contained in:
Ryan Huffman 2016-08-08 10:33:15 -07:00
parent 2a071c4329
commit fb14628a7e

View file

@ -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);
});