mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
This commit is contained in:
parent
3eb4eb3009
commit
bc472c02f3
2 changed files with 7 additions and 5 deletions
|
|
@ -224,7 +224,7 @@ local function step_springs(dt: number)
|
||||||
local ff_123 = u_123*-c
|
local ff_123 = u_123*-c
|
||||||
local ff_456 = u_456*-c
|
local ff_456 = u_456*-c
|
||||||
|
|
||||||
|
data.a, data.b = fs_123.X, ff_123.X
|
||||||
--assert(math.abs(fs_123.X) >= (math.abs(ff_123.X)), "damping exceeds restoring")
|
--assert(math.abs(fs_123.X) >= (math.abs(ff_123.X)), "damping exceeds restoring")
|
||||||
|
|
||||||
-- calculate acceleration step
|
-- calculate acceleration step
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ local function step(): number
|
||||||
local FPS = 60
|
local FPS = 60
|
||||||
local DT = 1/FPS
|
local DT = 1/FPS
|
||||||
|
|
||||||
repeat until os.clock() - program_time >= DT
|
repeat until os.clock() - program_time >= DT*10
|
||||||
program_time += DT
|
program_time += DT*10
|
||||||
return DT
|
return DT
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ local function main()
|
||||||
local effect = vide.effect
|
local effect = vide.effect
|
||||||
|
|
||||||
local value = source(MAX)
|
local value = source(MAX)
|
||||||
local sprung, data = (spring :: any)(value, 1, 19.16)
|
local sprung, data = (spring :: any)(value, 1, 19.6)
|
||||||
|
|
||||||
effect(function()
|
effect(function()
|
||||||
local v = sprung()
|
local v = sprung()
|
||||||
|
|
@ -49,7 +49,9 @@ local function main()
|
||||||
local offset = string.rep("\n", MAX - fv + OFFSET)
|
local offset = string.rep("\n", MAX - fv + OFFSET)
|
||||||
local bar = testkit.color.gray(remainder_to_block(v - fv) .. "\n" .. string.rep(BLOCK .. "\n", fv))
|
local bar = testkit.color.gray(remainder_to_block(v - fv) .. "\n" .. string.rep(BLOCK .. "\n", fv))
|
||||||
local num = "\n" .. v
|
local num = "\n" .. v
|
||||||
print(reset .. offset .. bar .. num)
|
local test = "\n" .. (data.a or 0)
|
||||||
|
local test2 = "\n" .. (data.b or 0)
|
||||||
|
print(reset .. offset .. bar .. num .. test .. test2)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local T = 1.5
|
local T = 1.5
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue