Class: FlameChannelParser::Segments::ConstantSegment
- Inherits:
-
Object
- Object
- FlameChannelParser::Segments::ConstantSegment
- Defined in:
- lib/segments.rb
Overview
This segment just stays on the value of it’s keyframe
Direct Known Subclasses
Constant Summary collapse
- NEG_INF =
:nodoc:
(-1.0/0.0)
- POS_INF =
(1.0/0.0)
Instance Attribute Summary collapse
-
#end_frame ⇒ Object
readonly
Returns the value of attribute end_frame.
-
#start_frame ⇒ Object
readonly
Returns the value of attribute start_frame.
Instance Method Summary collapse
-
#defines?(frame) ⇒ Boolean
Tells whether this segment defines the value of the function at this time T.
-
#initialize(from_frame, to_frame, value) ⇒ ConstantSegment
constructor
A new instance of ConstantSegment.
-
#value_at(frame) ⇒ Object
Returns the value at this time T.
Constructor Details
#initialize(from_frame, to_frame, value) ⇒ ConstantSegment
Returns a new instance of ConstantSegment.
23 24 25 26 27 |
# File 'lib/segments.rb', line 23 def initialize(from_frame, to_frame, value) @start_frame = from_frame @end_frame = to_frame @v1 = value end |
Instance Attribute Details
#end_frame ⇒ Object (readonly)
Returns the value of attribute end_frame.
11 12 13 |
# File 'lib/segments.rb', line 11 def end_frame @end_frame end |
#start_frame ⇒ Object (readonly)
Returns the value of attribute start_frame.
11 12 13 |
# File 'lib/segments.rb', line 11 def start_frame @start_frame end |
Instance Method Details
#defines?(frame) ⇒ Boolean
Tells whether this segment defines the value of the function at this time T
14 15 16 |
# File 'lib/segments.rb', line 14 def defines?(frame) (frame < end_frame) && (frame >= start_frame) end |
#value_at(frame) ⇒ Object
Returns the value at this time T
19 20 21 |
# File 'lib/segments.rb', line 19 def value_at(frame) @v1 end |