Class: TuioCursor
Instance Attribute Summary collapse
-
#finger_id ⇒ Object
readonly
Returns the value of attribute finger_id.
-
#motion_accel ⇒ Object
readonly
Returns the value of attribute motion_accel.
-
#x_speed ⇒ Object
readonly
Returns the value of attribute x_speed.
-
#y_speed ⇒ Object
readonly
Returns the value of attribute y_speed.
Attributes included from TuioContainer
Instance Method Summary collapse
- #args_equal?(args) ⇒ Boolean
-
#initialize(session_id, x_pos, y_pos) ⇒ TuioCursor
constructor
, x_speed, y_speed, motion_accel ).
- #inspect ⇒ Object
Methods included from TuioContainer
Constructor Details
#initialize(session_id, x_pos, y_pos) ⇒ TuioCursor
, x_speed, y_speed, motion_accel )
6 7 8 9 10 11 12 |
# File 'lib/tuio_cursor.rb', line 6 def initialize( session_id, x_pos, y_pos ) #, x_speed, y_speed, motion_accel ) super( session_id, x_pos, y_pos ) @x_speed = 0.0 @y_speed = 0.0 @motion_accel = 0.0 end |
Instance Attribute Details
#finger_id ⇒ Object (readonly)
Returns the value of attribute finger_id.
4 5 6 |
# File 'lib/tuio_cursor.rb', line 4 def finger_id @finger_id end |
#motion_accel ⇒ Object (readonly)
Returns the value of attribute motion_accel.
4 5 6 |
# File 'lib/tuio_cursor.rb', line 4 def motion_accel @motion_accel end |
#x_speed ⇒ Object (readonly)
Returns the value of attribute x_speed.
4 5 6 |
# File 'lib/tuio_cursor.rb', line 4 def x_speed @x_speed end |
#y_speed ⇒ Object (readonly)
Returns the value of attribute y_speed.
4 5 6 |
# File 'lib/tuio_cursor.rb', line 4 def y_speed @y_speed end |
Instance Method Details
#args_equal?(args) ⇒ Boolean
14 15 16 17 18 19 20 |
# File 'lib/tuio_cursor.rb', line 14 def args_equal?( args ) super( args_to_container_from_cursor( args ) ) && @x_speed.approx_equal?(args[3] ) && @y_speed.approx_equal?(args[4] ) && @motion_accel.approx_equal?(args[5] ) end |
#inspect ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/tuio_cursor.rb', line 22 def inspect puts "TuioCursor:" puts "session_id >> #{session_id}" puts "x_pos >> #{x_pos}" puts "y_pos >> #{y_pos}" puts "x_speed >> #{x_speed}" puts "y_speed >> #{y_speed}" puts "motion_accel >> #{motion_accel}" end |