35 FrameCtrl(f32 start, f32 end, PlayPolicyFunc policy)
36 : m_frame(0.0f), m_updateRate(1.0f), m_startFrame(start), m_endFrame(end),
37 m_playPolicy(policy) {
42 setFrame(m_updateRate * s_baseUpdateRate + m_frame);
46 [[nodiscard]] f32 frame()
const {
50 [[nodiscard]] f32 rate()
const {
54 [[nodiscard]] PlayPolicyFunc playPolicy()
const {
60 void setFrame(f32 frame) {
61 m_frame = m_playPolicy(m_startFrame, m_endFrame, frame);
64 void setRate(f32 rate) {
68 void setPlayPolicy(PlayPolicyFunc func) {
79 PlayPolicyFunc m_playPolicy;
81 static f32 s_baseUpdateRate;