Class: FlameChannelParser::Segments::LinearExtrapolate
- Inherits:
-
ConstantExtrapolate
- Object
- ConstantSegment
- LinearSegment
- ConstantExtrapolate
- FlameChannelParser::Segments::LinearExtrapolate
- Defined in:
- lib/segments.rb
Overview
This segment does extrapolation using the tangent from the preceding keyframe
Constant Summary
Constants inherited from ConstantSegment
ConstantSegment::NEG_INF, ConstantSegment::POS_INF
Instance Attribute Summary
Attributes inherited from ConstantSegment
Instance Method Summary collapse
-
#initialize(from_frame, base_value, tangent) ⇒ LinearExtrapolate
constructor
:nodoc:.
- #value_at(frame) ⇒ Object
Methods inherited from ConstantSegment
Constructor Details
#initialize(from_frame, base_value, tangent) ⇒ LinearExtrapolate
:nodoc:
228 229 230 231 |
# File 'lib/segments.rb', line 228 def initialize(from_frame, base_value, tangent) super(from_frame, base_value) @tangent = tangent.to_f end |
Instance Method Details
#value_at(frame) ⇒ Object
233 234 235 236 |
# File 'lib/segments.rb', line 233 def value_at(frame) frame_diff = (frame - @start_frame) @base_value + (@tangent * frame_diff) end |