Nearly perfect sync between transform and animation, but not sure how to replicate that reliably.
This commit is contained in:
parent
d4e79f1d3d
commit
34e4a34f65
4 changed files with 4 additions and 9 deletions
|
|
@ -55,7 +55,7 @@ namespace animate2 {
|
|||
if($sequence.subframe > 0.9) $sequence.subframe = 0.0f;
|
||||
frame_change = true;
|
||||
} else {
|
||||
$sequence.subframe = std::lerp($sequence.subframe, 1.0, $sequence.timer.alpha * $transform.ease_rate);
|
||||
$sequence.subframe = std::lerp($sequence.subframe, 1.0, $sequence.timer.DELTA * $transform.ease_rate);
|
||||
fmt::println("subframe: {}, alpha: {}", $sequence.subframe, $sequence.timer.alpha);
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,6 @@ namespace animate2 {
|
|||
}
|
||||
|
||||
void Animate2::update() {
|
||||
// $sequence.subframe += $transform.speed;
|
||||
update_frame();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ namespace animate2 {
|
|||
bool simple{true};
|
||||
bool flipped{false};
|
||||
float ease_rate{0.5f};
|
||||
float speed{0.1f};
|
||||
bool scaled{false};
|
||||
bool stationary{false};
|
||||
// these can handled by the onLoop, same as ganim8 does it
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ Animate2 crafter() {
|
|||
.simple{false},
|
||||
.flipped{false},
|
||||
.ease_rate{0.5f},
|
||||
.speed{0.02f},
|
||||
.scaled{true},
|
||||
.stationary{true},
|
||||
.toggled{false},
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ animate2::Sheet sheet{
|
|||
|
||||
animate2::Sequence sequence{
|
||||
.frames{0,1,0,1},
|
||||
.durations{166ms, 266ms, 166ms, 266ms}
|
||||
.durations{500ms, 266ms, 100ms, 100ms}
|
||||
};
|
||||
|
||||
animate2::Transform scale_tr{
|
||||
|
|
@ -167,13 +167,12 @@ animate2::Transform scale_tr{
|
|||
.max_y{0.8f},
|
||||
.simple{false},
|
||||
.flipped{false},
|
||||
.ease_rate{0.5f},
|
||||
.speed{0.02f},
|
||||
.ease_rate{1.0f/0.2f},
|
||||
.scaled{true},
|
||||
.stationary{true},
|
||||
.toggled{false},
|
||||
.looped{true},
|
||||
.easing = ease2::out_circle,
|
||||
.easing = ease2::in_out_back,
|
||||
.motion = ease2::move_rush,
|
||||
};
|
||||
|
||||
|
|
@ -185,7 +184,6 @@ animate2::Transform move_tr{
|
|||
.simple{false},
|
||||
.flipped{false},
|
||||
.ease_rate{2.5f},
|
||||
.speed{0.02f},
|
||||
.scaled{true},
|
||||
.stationary{true},
|
||||
.toggled{false},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue