mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-07 20:09:58 -05:00
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:
@@ -235,7 +235,7 @@ void RenderableBoxGrid::update(const UpdateData&) {
|
||||
_varray.push_back({ v7.x, v7.y, v7.z });
|
||||
_varray.push_back({ v3.x, v3.y, v3.z });
|
||||
|
||||
setBoundingSphere(static_cast<double>(glm::length(urb)));
|
||||
setBoundingSphere(glm::length(glm::dvec3(urb)));
|
||||
|
||||
glBindVertexArray(_vaoID);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _vBufferID);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -575,7 +575,7 @@ bool RenderableDUMeshes::readSpeckFile() {
|
||||
}
|
||||
|
||||
// Check if new max radius
|
||||
const double r = static_cast<double>(glm::length(pos));
|
||||
const double r = glm::length(glm::dvec3(pos));
|
||||
maxRadius = std::max(maxRadius, r);
|
||||
|
||||
// OLD CODE:
|
||||
|
||||
Reference in New Issue
Block a user