From a9b8bec7b4e7798ea69b7844b97b6c220a3acbb2 Mon Sep 17 00:00:00 2001 From: Kalle Bladin Date: Wed, 17 Aug 2016 00:38:18 -0400 Subject: [PATCH] Remove parts of bounding sphere definition in SceneGraphNode. --- include/openspace/scene/scenegraphnode.h | 18 +++++++++--------- src/scene/scenegraphnode.cpp | 6 ++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index 3fbdee1216..4979eedcf8 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -113,15 +113,6 @@ private: glm::dmat3 calculateWorldRotation() const; double calculateWorldScale() const; - // Transformation defined by ephemeris, rotation and scale - Ephemeris* _ephemeris; - Rotation* _rotation; - Scale* _scale; - - glm::dvec3 _worldPositionCached; - glm::dmat3 _worldRotationCached; - double _worldScaleCached; - std::vector _children; SceneGraphNode* _parent; @@ -133,6 +124,15 @@ private: bool _boundingSphereVisible; PowerScaledScalar _boundingSphere; + // Transformation defined by ephemeris, rotation and scale + Ephemeris* _ephemeris; + Rotation* _rotation; + Scale* _scale; + + // Cached transform data + glm::dvec3 _worldPositionCached; + glm::dmat3 _worldRotationCached; + double _worldScaleCached; }; } // namespace openspace diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index a26bfbf4c9..b9c04af696 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -474,7 +474,9 @@ const std::vector& SceneGraphNode::children() const{ PowerScaledScalar SceneGraphNode::calculateBoundingSphere(){ // set the bounding sphere to 0.0 _boundingSphere = 0.0; - + /* + This is not how to calculate a bounding sphere, better to leave it at 0 if not a + renderable. --KB if (!_children.empty()) { // node PowerScaledScalar maxChild; @@ -492,7 +494,7 @@ PowerScaledScalar SceneGraphNode::calculateBoundingSphere(){ } _boundingSphere += maxChild; } - + */ // if has a renderable, use that boundingsphere if (_renderable ) { PowerScaledScalar renderableBS = _renderable->getBoundingSphere();