Class: TuioCursor

Inherits:
Object show all
Includes:
TuioContainer
Defined in:
lib/tuio_cursor.rb

Instance Attribute Summary collapse

Attributes included from TuioContainer

#session_id, #x_pos, #y_pos

Instance Method Summary collapse

Methods included from TuioContainer

#path, #update

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_idObject (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_accelObject (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_speedObject (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_speedObject (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

Returns:

  • (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

#inspectObject



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