mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-28 23:09:32 -05:00
Fix GlobeRotation/Translation not updating if simulation time is paused
This commit is contained in:
@@ -112,19 +112,19 @@ GlobeRotation::GlobeRotation(const ghoul::Dictionary& dictionary)
|
||||
_globe = p.globe;
|
||||
|
||||
_latitude = p.latitude.value_or(_latitude);
|
||||
_latitude.onChange([this]() { _matrixIsDirty = true; });
|
||||
_latitude.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_latitude);
|
||||
|
||||
_longitude = p.longitude.value_or(_longitude);
|
||||
_longitude.onChange([this]() { _matrixIsDirty = true; });
|
||||
_longitude.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_longitude);
|
||||
|
||||
_useHeightmap = p.useHeightmap.value_or(_useHeightmap);
|
||||
_useHeightmap.onChange([this]() { _matrixIsDirty = true; });
|
||||
_useHeightmap.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_useHeightmap);
|
||||
|
||||
_angle = p.angle.value_or(_angle);
|
||||
_angle.onChange([this]() { _matrixIsDirty = true; });
|
||||
_angle.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_angle);
|
||||
}
|
||||
|
||||
@@ -145,6 +145,11 @@ void GlobeRotation::findGlobe() {
|
||||
}
|
||||
}
|
||||
|
||||
void GlobeRotation::setUpdateVariables() {
|
||||
_matrixIsDirty = true;
|
||||
requireUpdate();
|
||||
}
|
||||
|
||||
glm::vec3 GlobeRotation::computeSurfacePosition(double latitude, double longitude) const
|
||||
{
|
||||
ghoul_assert(_globeNode, "Globe cannot be nullptr");
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
|
||||
private:
|
||||
void findGlobe();
|
||||
void setUpdateVariables();
|
||||
glm::vec3 computeSurfacePosition(double latitude, double longitude) const;
|
||||
|
||||
properties::StringProperty _globe;
|
||||
|
||||
@@ -113,20 +113,20 @@ GlobeTranslation::GlobeTranslation(const ghoul::Dictionary& dictionary)
|
||||
_globe = p.globe;
|
||||
|
||||
_latitude = p.latitude.value_or(_latitude);
|
||||
_latitude.onChange([this]() { _positionIsDirty = true; });
|
||||
_latitude.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_latitude);
|
||||
|
||||
_longitude = p.longitude.value_or(_longitude);
|
||||
_longitude.onChange([this]() { _positionIsDirty = true; });
|
||||
_longitude.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_longitude);
|
||||
|
||||
_altitude = p.altitude.value_or(_altitude);
|
||||
_altitude.setExponent(8.f);
|
||||
_altitude.onChange([this]() { _positionIsDirty = true; });
|
||||
_altitude.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_altitude);
|
||||
|
||||
_useHeightmap = p.useHeightmap.value_or(_useHeightmap);
|
||||
_useHeightmap.onChange([this]() { _positionIsDirty = true; });
|
||||
_useHeightmap.onChange([this]() { setUpdateVariables(); });
|
||||
addProperty(_useHeightmap);
|
||||
}
|
||||
|
||||
@@ -147,6 +147,11 @@ void GlobeTranslation::fillAttachedNode() {
|
||||
}
|
||||
}
|
||||
|
||||
void GlobeTranslation::setUpdateVariables() {
|
||||
_positionIsDirty = true;
|
||||
requireUpdate();
|
||||
}
|
||||
|
||||
glm::dvec3 GlobeTranslation::position(const UpdateData&) const {
|
||||
if (!_attachedNode) {
|
||||
// @TODO(abock): The const cast should be removed on a redesign of the translation
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
|
||||
private:
|
||||
void fillAttachedNode();
|
||||
void setUpdateVariables();
|
||||
|
||||
properties::StringProperty _globe;
|
||||
properties::DoubleProperty _latitude;
|
||||
|
||||
Reference in New Issue
Block a user