Update RenderableGlobe to use transformation from SceneGraphnNode and fix bug in SpiceRotation.

This commit is contained in:
Kalle Bladin
2016-08-18 14:21:20 -04:00
parent b5b388bf54
commit ae1f8e457b
12 changed files with 54 additions and 79 deletions
+4 -20
View File
@@ -78,31 +78,15 @@ const glm::dmat3& SpiceRotation::matrix() const {
void SpiceRotation::update(const UpdateData& data) {
if (!_kernelsLoadedSuccessfully)
return;
// TODO : Need to be checking for real if the frame is fixed since fixed frames
// do not have CK coverage.
bool sourceFrameIsFixed = _sourceFrame == "GALACTIC";
bool destinationFrameIsFixed = _destinationFrame == "GALACTIC";
bool sourceHasCoverage =
!_sourceFrame.empty() &&
SpiceManager::ref().hasFrameId(_sourceFrame) &&
(SpiceManager::ref().hasCkCoverage(_sourceFrame, data.time) ||
sourceFrameIsFixed);
bool destinationHasCoverage =
!_destinationFrame.empty() &&
SpiceManager::ref().hasFrameId(_destinationFrame) &&
(SpiceManager::ref().hasCkCoverage(_destinationFrame, data.time) ||
destinationFrameIsFixed);
if (sourceHasCoverage && destinationHasCoverage) {
try {
_rotationMatrix = SpiceManager::ref().positionTransformMatrix(
_sourceFrame,
_destinationFrame,
data.time);
}
else {
_rotationMatrix = glm::dmat3(1.0);
catch (const ghoul::RuntimeError&) {
// In case of missing coverage
_rotationMatrix = glm::dmat3(1);
}
}