Copyright | (C) 2015 Dimitri Sabadie |
---|---|
License | BSD3 |
Maintainer | Dimitri Sabadie <dimitri.sabadie@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Spline
A Spline
is a collection of keys with associated interpolation modes.
Given two keys which indices are i and i+1, the interpolation mode on the
resulting curve is performed using the interpolation mode of the key i.
Thus, the interpolation mode of the latest key might be ignored. There’s an
exception, though, when using the Bezier
interpolation mode.
splineKeys :: Spline a s -> Vector (Key (a s)) Source
Extract the keys.
splineSampler :: Spline a s -> a s -> s Source
Extract the sampler.
Building splines
spline :: Ord s => (a s -> s) -> [Key (a s)] -> Spline a s Source
Build a 'Spline a s'.
'a s' is the type hold by keys. For instance, V2 Float
.
The first argument of the function, which has type a s -> s
is a function
used to extract the sampling value of each keys. In most cases, that value
represents the time or the frame of a simulation. That value is used to
perform sampling comparison.