Correctly update scale, rotation, and scale classes where multiple subtypes are involved

This commit is contained in:
Alexander Bock
2025-05-01 18:00:36 +02:00
parent 1e458ab2e8
commit f704bc9bb8
14 changed files with 62 additions and 2 deletions
+12
View File
@@ -81,6 +81,18 @@ TimelineScale::TimelineScale(const ghoul::Dictionary& dictionary)
addProperty(_shouldInterpolate);
}
void TimelineScale::update(const UpdateData& data) {
const double now = data.time.j2000Seconds();
using KeyframePointer = const Keyframe<ghoul::mm_unique_ptr<Scale>>*;
if (KeyframePointer prev = _timeline.lastKeyframeBefore(now, true); prev) {
prev->data->update(data);
}
if (KeyframePointer next = _timeline.firstKeyframeAfter(now, true); next) {
next->data->update(data);
}
}
glm::dvec3 TimelineScale::scaleValue(const UpdateData& data) const {
const double now = data.time.j2000Seconds();
using KeyframePointer = const Keyframe<ghoul::mm_unique_ptr<Scale>>*;