36 FrameCtrl(f32 start, f32 end, PlayPolicyFunc policy)
37 : m_frame(0.0f), m_updateRate(1.0f), m_startFrame(start), m_endFrame(end),
38 m_playPolicy(policy) {
43 setFrame(m_updateRate * s_baseUpdateRate + m_frame);
47 [[nodiscard]] f32 frame()
const {
51 [[nodiscard]] f32 rate()
const {
55 [[nodiscard]] PlayPolicyFunc playPolicy()
const {
61 void setFrame(f32 frame) {
62 m_frame = m_playPolicy(m_startFrame, m_endFrame, frame);
65 void setRate(f32 rate) {
69 void setPlayPolicy(PlayPolicyFunc func) {
80 PlayPolicyFunc m_playPolicy;
82 static f32 s_baseUpdateRate;
Contexts can be used to restore a previous memory state for the current session.