Commit 3b2e262
committed
Keyframe: New implementation calculating values ondemand
- GetValue() calculates the value at the given position now ondemand,
without caching values as previously. First, it uses binary search
to find the segment (start and end point) containing the given
position. Constant and linear interpolation are straightforward,
bezier curves are calculating by binary search between the end
points until a point on the curve is found with a X coordinate close
enough to the given position. That points Y coordinate is returned.
- IsIncreasing(), GetRepeatFraction(), GetDelta() use GetValue()
instead of accessing the (removed) Values vector.
- Removed now unused private functions, and the unused public
Process().
First test results show good performance improvements for the
"rendering case" (setting up the keyframe points at once, then getting
all values) and drastic performance improvements for the "preview
case" (changing keyframe points, mixed with getting values).1 parent bd82403 commit 3b2e262
2 files changed
+105
-412
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | 66 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 67 | | |
86 | 68 | | |
87 | 69 | | |
| |||
155 | 137 | | |
156 | 138 | | |
157 | 139 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 140 | | |
167 | 141 | | |
168 | 142 | | |
| |||
0 commit comments