Class: FlameChannelParser::Segments::ConstantSegment

Inherits:
Object
  • Object
show all
Defined in:
lib/segments.rb

Overview

This segment just stays on the value of it's keyframe

Direct Known Subclasses

ConstantFunction, LinearSegment

Constant Summary

NEG_INF =

:nodoc:

(-1.0/0.0)
POS_INF =
(1.0/0.0)

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ConstantSegment) initialize(from_frame, to_frame, value)

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

- (Object) end_frame (readonly)

Returns the value of attribute end_frame



11
12
13
# File 'lib/segments.rb', line 11

def end_frame
  @end_frame
end

- (Object) start_frame (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

- (Boolean) defines?(frame)

Tells whether this segment defines the value of the function at this time T

Returns:

  • (Boolean)


14
15
16
# File 'lib/segments.rb', line 14

def defines?(frame)
  (frame < end_frame) && (frame >= start_frame)
end

- (Object) value_at(frame)

Returns the value at this time T



19
20
21
# File 'lib/segments.rb', line 19

def value_at(frame)
  @v1
end