Skip to content

Commit

Permalink
Fixed CullNode bounding sphere radius.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Sep 25, 2024
1 parent 3632644 commit a2ceceb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vsg/utils/Builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ ref_ptr<Node> Builder::decorateAndCompileIfRequired(const GeometryInfo& info, co
bound.add(v);
}
cullNode->bound.center = (bound.min + bound.max) * 0.5f;
cullNode->bound.radius = vsg::length(bound.max - bound.min) * 0.5 + vsg::length(info.dx + info.dy + info.dz);
cullNode->bound.radius = vsg::length(bound.max - bound.min) * 0.5 + vsg::length(info.dx + info.dy + info.dz) * 0.5;
}
else
{
Expand All @@ -263,7 +263,7 @@ ref_ptr<Node> Builder::decorateAndCompileIfRequired(const GeometryInfo& info, co
else
{
cullNode->bound.center = info.position;
cullNode->bound.radius = vsg::length(info.dx + info.dy + info.dz);
cullNode->bound.radius = vsg::length(info.dx + info.dy + info.dz) * 0.5;
}

subgraph = cullNode;
Expand Down

0 comments on commit a2ceceb

Please sign in to comment.