mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-20 01:01:10 -05:00
Add explicit checks whenever we are accessing another scene graph node (closes #1831)
This commit is contained in:
@@ -2033,6 +2033,14 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog
|
||||
SceneGraphNode* casterNode =
|
||||
global::renderEngine->scene()->sceneGraphNode(caster);
|
||||
|
||||
if ((sourceNode == nullptr) || (casterNode == nullptr)) {
|
||||
LERRORC(
|
||||
"Renderableglobe",
|
||||
"Invalid scenegraph node for the shadow's caster or shadow's receiver."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const double sourceRadiusScale = std::max(
|
||||
glm::compMax(sourceNode->scale()),
|
||||
1.0
|
||||
@@ -2043,14 +2051,6 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog
|
||||
1.0
|
||||
);
|
||||
|
||||
if ((sourceNode == nullptr) || (casterNode == nullptr)) {
|
||||
LERRORC(
|
||||
"Renderableglobe",
|
||||
"Invalid scenegraph node for the shadow's caster or shadow's receiver."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// First we determine if the caster is shadowing the current planet (all
|
||||
// calculations in World Coordinates):
|
||||
const glm::dvec3 planetCasterVec = casterPos - data.modelTransform.translation;
|
||||
|
||||
Reference in New Issue
Block a user