Class: Artoo::Drivers::Leapmotion::Frame
- Inherits:
-
Object
- Object
- Artoo::Drivers::Leapmotion::Frame
- Defined in:
- lib/artoo/drivers/leapmotion/frame.rb
Instance Attribute Summary collapse
-
#gestures ⇒ Object
readonly
Returns the value of attribute gestures.
-
#hands ⇒ Object
readonly
Returns the value of attribute hands.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#pointables ⇒ Object
readonly
Returns the value of attribute pointables.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#rotation ⇒ Object
readonly
Returns the value of attribute rotation.
-
#scale_factor ⇒ Object
readonly
Returns the value of attribute scale_factor.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#translation ⇒ Object
readonly
Returns the value of attribute translation.
Instance Method Summary collapse
-
#initialize(frame) ⇒ Frame
constructor
Public: initialize.
Constructor Details
#initialize(frame) ⇒ Frame
Public: initialize
frame - params
Returns nil
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 17 def initialize(frame) @id = frame["id"] @timestamp = frame["timestamp"] @raw = frame @hands = Artoo::Drivers::Leapmotion::Hand.list(frame) @gestures = Artoo::Drivers::Leapmotion::Gesture.list(frame) @pointables = Artoo::Drivers::Leapmotion::Pointable.list(frame) @rotation = { axis: frame['r'][0], angle: frame['r'][1], matrix: frame['r'][2] } @scale_factor = frame["s"] @translation = frame["t"] end |
Instance Attribute Details
#gestures ⇒ Object (readonly)
Returns the value of attribute gestures.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def gestures @gestures end |
#hands ⇒ Object (readonly)
Returns the value of attribute hands.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def hands @hands end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def id @id end |
#pointables ⇒ Object (readonly)
Returns the value of attribute pointables.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def pointables @pointables end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def raw @raw end |
#rotation ⇒ Object (readonly)
Returns the value of attribute rotation.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def rotation @rotation end |
#scale_factor ⇒ Object (readonly)
Returns the value of attribute scale_factor.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def scale_factor @scale_factor end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def @timestamp end |
#translation ⇒ Object (readonly)
Returns the value of attribute translation.
9 10 11 |
# File 'lib/artoo/drivers/leapmotion/frame.rb', line 9 def translation @translation end |