Remove parts of bounding sphere definition in SceneGraphNode.

This commit is contained in:
Kalle Bladin
2016-08-17 00:38:18 -04:00
parent c01808ce10
commit a9b8bec7b4
2 changed files with 13 additions and 11 deletions

View File

@@ -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<SceneGraphNode*> _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

View File

@@ -474,7 +474,9 @@ const std::vector<SceneGraphNode*>& 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();