mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-27 22:40:41 -05:00
Turn the scaling transformation into providing three scaling factors (x, y, z)
Add NonUniformStaticScale class to provide independent scaling factors (closes #1151)
This commit is contained in:
@@ -108,7 +108,7 @@ TimeDependentScale::TimeDependentScale(const ghoul::Dictionary& dictionary)
|
||||
addProperty(_clampToPositive);
|
||||
}
|
||||
|
||||
double TimeDependentScale::scaleValue(const UpdateData& data) const {
|
||||
glm::dvec3 TimeDependentScale::scaleValue(const UpdateData& data) const {
|
||||
if (_cachedReferenceDirty) {
|
||||
_cachedReference = Time::convertTime(_referenceDate);
|
||||
_cachedReferenceDirty = false;
|
||||
@@ -118,10 +118,10 @@ double TimeDependentScale::scaleValue(const UpdateData& data) const {
|
||||
const double dt = now - _cachedReference;
|
||||
|
||||
if (_clampToPositive) {
|
||||
return std::max(0.0, dt) * _speed;
|
||||
return glm::dvec3(std::max(0.0, dt) * _speed);
|
||||
}
|
||||
else {
|
||||
return dt * _speed;
|
||||
return glm::dvec3(dt * _speed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user