Fix problems with precision of new bounding spheres

glm::length => squared computation => we need the double precision in the computation. Got bounding sphere values of "inf" for a few large renderables (the DU grids)...
This commit is contained in:
Emma Broman
2022-03-28 19:53:14 +02:00
parent 3c4f13c650
commit f7d3d3bad1
3 changed files with 3 additions and 3 deletions

View File

@@ -243,7 +243,7 @@ void RenderableGrid::update(const UpdateData&) {
_varray[nr++] = { halfSize.x, y1, 0.f };
}
setBoundingSphere(static_cast<double>(glm::length(halfSize)));
setBoundingSphere(glm::length(glm::dvec2(halfSize)));
glBindVertexArray(_vaoID);
glBindBuffer(GL_ARRAY_BUFFER, _vBufferID);