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:
Alexander Bock
2020-05-12 15:27:24 +02:00
parent 3b427bfd15
commit f7170a9506
17 changed files with 172 additions and 40 deletions
+3 -3
View File
@@ -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);
}
}