mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
fix vca duration calculation
This commit is contained in:
parent
7f15cd897c
commit
2104bc7670
2 changed files with 8 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ local function parse_configure(raw_track, node)
|
|||
raw_track.fps = node.fps
|
||||
end
|
||||
if node.frames then
|
||||
raw_track.duration = node.frames / node.fps
|
||||
raw_track.duration = node.frames / (node.fps or DEFAULT_FPS)
|
||||
elseif node.duration then
|
||||
raw_track.duration = node.duration
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
local ALMOST_HUGE = 1e9
|
||||
|
||||
local rig = entity.skeleton
|
||||
|
||||
local states = {}
|
||||
|
|
@ -50,7 +52,11 @@ local function update(delta)
|
|||
|
||||
state.track = state.track or animation.get_track(state.track_id)
|
||||
if state.track and intensity > 0.0 then
|
||||
state.track.func(rig, state.timer, intensity * state.max_intencity)
|
||||
state.track.func(
|
||||
rig,
|
||||
state.timer % math.min(ALMOST_HUGE, state.track.duration),
|
||||
intensity * state.max_intencity
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue