Refactor the story->camera converter to be a part of the camera.
This commit is contained in:
parent
024d0cfae7
commit
088f9e022e
3 changed files with 19 additions and 14 deletions
13
camera.cpp
13
camera.cpp
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue