Class: FlameChannelParser::Segments::LinearSegment
- Inherits:
-
ConstantSegment
- Object
- ConstantSegment
- FlameChannelParser::Segments::LinearSegment
- Defined in:
- lib/segments.rb
Overview
This segment linearly interpolates
Direct Known Subclasses
BezierSegment, ConstantExtrapolate, ConstantPrepolate, HermiteSegment, LinearPrepolate
Constant Summary
Constant Summary
Constants inherited from ConstantSegment
ConstantSegment::NEG_INF, ConstantSegment::POS_INF
Instance Attribute Summary
Attributes inherited from ConstantSegment
Instance Method Summary (collapse)
-
- (LinearSegment) initialize(from_frame, to_frame, value1, value2)
constructor
:nodoc:.
-
- (Object) value_at(frame)
Returns the value at this time T.
Methods inherited from ConstantSegment
Constructor Details
- (LinearSegment) initialize(from_frame, to_frame, value1, value2)
:nodoc:
33 34 35 36 |
# File 'lib/segments.rb', line 33 def initialize(from_frame, to_frame, value1, value2) @vint = (value2 - value1) super(from_frame, to_frame, value1) end |
Instance Method Details
- (Object) value_at(frame)
Returns the value at this time T
39 40 41 42 |
# File 'lib/segments.rb', line 39 def value_at(frame) on_t_interval = (frame - @start_frame).to_f / (@end_frame - @start_frame) @v1 + (on_t_interval * @vint) end |