lib/import/shake_script.rb in tracksperanto-1.6.5 vs lib/import/shake_script.rb in tracksperanto-1.6.6
- old
+ new
@@ -30,9 +30,19 @@
end
end
alias_method :nspline, :linear
alias_method :jspline, :linear
+ # Hermite interpolation looks like this
+ # Hermite(0,[1379.04,-0.02,-0.02]@1,[1379.04,-0.03,-0.03]@2)
+ # The first value in the array is the keyframe value, the other two are
+ # tangent positions (which we discard)
+ def hermite(initial_value, *keyframes)
+ report_progress("Translating Hermite curve, removing tangents")
+ values, at_frames = keyframes.partition{|e| e.is_a?(Array)}
+ values = values.map{|v| v[0] }
+ at_frames.zip(values)
+ end
# image Tracker(
# image In,
# const char * trackRange,
# const char * subPixelRes,
\ No newline at end of file