This commit is contained in:
Aaron Smith 2023-09-19 18:36:08 +01:00
parent d8a627c58a
commit 3eb4eb3009
2 changed files with 10 additions and 6 deletions

View file

@ -200,7 +200,7 @@ local function spring<T>(source: () -> T, period: number?, damping_ratio: number
return function()
track(output)
return output.cache
end
end, data
end
local function step_springs(dt: number)
@ -224,6 +224,9 @@ local function step_springs(dt: number)
local ff_123 = u_123*-c
local ff_456 = u_456*-c
--assert(math.abs(fs_123.X) >= (math.abs(ff_123.X)), "damping exceeds restoring")
-- calculate acceleration step
local dv_123 = (fs_123 + ff_123)*dt
local dv_456 = (fs_456 + ff_456)*dt