From a2ceceb0cac0e74406c9435c89b2b5ae8012598c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 25 Sep 2024 15:25:24 +0100 Subject: [PATCH] Fixed CullNode bounding sphere radius. --- src/vsg/utils/Builder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vsg/utils/Builder.cpp b/src/vsg/utils/Builder.cpp index 7fb73c968..fa42739c1 100644 --- a/src/vsg/utils/Builder.cpp +++ b/src/vsg/utils/Builder.cpp @@ -252,7 +252,7 @@ ref_ptr 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 { @@ -263,7 +263,7 @@ ref_ptr 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;