mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
More accurate animation playback speed
This commit is contained in:
parent
2ca0ef9712
commit
facc672f4a
@ -3,7 +3,7 @@ Animator.MolangParser.global_variables = {
|
||||
'true': 1,
|
||||
'false': 0,
|
||||
get 'query.delta_time'() {
|
||||
let time = (Date.now() - Timeline.last_frame_timecode + 1) / 1000;
|
||||
let time = (Date.now() - Timeline.last_frame_timecode) / 1000;
|
||||
if (time < 0) time += 1;
|
||||
return Math.clamp(time, 0, 0.1);
|
||||
},
|
||||
|
@ -501,8 +501,8 @@ const Timeline = {
|
||||
if (Animation.selected.loop == 'hold') {
|
||||
time = Math.clamp(time, 0, Animation.selected.length);
|
||||
}
|
||||
Timeline.setTime(time);
|
||||
Timeline.last_frame_timecode = Date.now();
|
||||
Timeline.setTime(time);
|
||||
|
||||
} else {
|
||||
if (Animation.selected.loop == 'loop' || BarItems.looped_animation_playback.value) {
|
||||
|
Loading…
Reference in New Issue
Block a user