Class: FlameChannelParser::Parser2012::ModernKey
- Inherits:
-
Struct
- Object
- Struct
- FlameChannelParser::Parser2012::ModernKey
- Defined in:
- lib/parser_2012.rb
Instance Attribute Summary (collapse)
-
- (Object) break_slope
Returns the value of attribute break_slope.
-
- (Object) curve_mode
Returns the value of attribute curve_mode.
-
- (Object) curve_order
Returns the value of attribute curve_order.
-
- (Object) frame
Returns the value of attribute frame.
-
- (Object) l_handle_x
Returns the value of attribute l_handle_x.
-
- (Object) l_handle_y
Returns the value of attribute l_handle_y.
-
- (Object) r_handle_x
Returns the value of attribute r_handle_x.
-
- (Object) r_handle_y
Returns the value of attribute r_handle_y.
-
- (Object) value
Returns the value of attribute value.
Instance Method Summary (collapse)
- - (Boolean) broken?
-
- (Object) interpolation
Adapter for old interpolation.
-
- (Object) left_slope
Compute pre-212 slope which we use for interpolations.
-
- (Object) right_slope
Compute pre-212 slope which we use for interpolations.
Instance Attribute Details
- (Object) break_slope
Returns the value of attribute break_slope
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def break_slope @break_slope end |
- (Object) curve_mode
Returns the value of attribute curve_mode
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def curve_mode @curve_mode end |
- (Object) curve_order
Returns the value of attribute curve_order
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def curve_order @curve_order end |
- (Object) frame
Returns the value of attribute frame
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def frame @frame end |
- (Object) l_handle_x
Returns the value of attribute l_handle_x
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def l_handle_x @l_handle_x end |
- (Object) l_handle_y
Returns the value of attribute l_handle_y
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def l_handle_y @l_handle_y end |
- (Object) r_handle_x
Returns the value of attribute r_handle_x
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def r_handle_x @r_handle_x end |
- (Object) r_handle_y
Returns the value of attribute r_handle_y
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def r_handle_y @r_handle_y end |
- (Object) value
Returns the value of attribute value
7 8 9 |
# File 'lib/parser_2012.rb', line 7 def value @value end |
Instance Method Details
- (Boolean) broken?
36 37 38 |
# File 'lib/parser_2012.rb', line 36 def broken? break_slope end |
- (Object) interpolation
Adapter for old interpolation
11 12 13 14 15 16 17 18 |
# File 'lib/parser_2012.rb', line 11 def interpolation return :constant if curve_order.to_s == "constant" return :hermite if curve_order.to_s == "cubic" && (curve_mode.to_s == "hermite" || curve_mode.to_s == "natural") return :bezier if curve_order.to_s == "cubic" && curve_mode.to_s == "bezier" return :linear if curve_order.to_s == "linear" raise "Cannot determine interpolation for #{self.inspect}" end |
- (Object) left_slope
Compute pre-212 slope which we use for interpolations
21 22 23 24 25 26 27 |
# File 'lib/parser_2012.rb', line 21 def left_slope return right_slope unless broken? dy = value - l_handle_y dx = l_handle_x - frame dy / dx * -1 end |
- (Object) right_slope
Compute pre-212 slope which we use for interpolations
30 31 32 33 34 |
# File 'lib/parser_2012.rb', line 30 def right_slope dy = value - r_handle_y dx = frame - r_handle_x dy / dx end |