Refactor the story->camera converter to be a part of the camera.

This commit is contained in:
Zed A. Shaw 2026-02-22 23:02:02 -05:00
parent 024d0cfae7
commit 088f9e022e
3 changed files with 19 additions and 14 deletions

View file

@ -115,4 +115,17 @@ namespace cinematic {
void Camera::play() {
anim.play();
}
void Camera::from_story(components::Storyboard& story) {
anim.sequences.clear();
anim.forms.clear();
for(auto& [timecode, cell, transform] : story.beats) {
animate2::Sequence seq{.frames={0}, .durations={60}};
anim.sequences.try_emplace(timecode, seq);
animate2::Form form{timecode, transform};
anim.forms.try_emplace(timecode, form);
}
}
}