Skip to content

Commit 768490c

Browse files
author
Ella
committed
Remove SolveBulk
1 parent 308fac9 commit 768490c

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

src/init.lua

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -308,32 +308,4 @@ function CatRom:SolveRotCFrame(t: number, unitSpeed: boolean?)
308308
return spline:SolveRotCFrame(if unitSpeed then spline:Reparametrize(splineTime) else splineTime)
309309
end
310310

311-
-- Utility function for calling a method on n uniformly-spaced points in [a, b].
312-
-- TODO: Bulk GetSplineAtTime
313-
-- TODO: Bulk ReparametrizeHybrid
314-
function CatRom:SolveBulk(f: (table, number) -> any, n: number, a: number?, b: number?)
315-
n = math.round(n)
316-
a = a or 0
317-
b = b or 1
318-
319-
if a == b then
320-
return table.create(f(self, a), n)
321-
elseif n < 1 then
322-
return
323-
elseif n == 1 then
324-
return {f(self, a)}
325-
end
326-
327-
local outputs = table.create(n)
328-
outputs[1] = f(self, a)
329-
outputs[n] = f(self, b)
330-
331-
local increment = (b - a) / (n - 1)
332-
for i = 1, n - 2 do
333-
outputs[i + 1] = f(self, a + increment * i)
334-
end
335-
336-
return outputs
337-
end
338-
339311
return CatRom

0 commit comments

Comments
 (0)