Class: TuioCursor

Inherits:
TuioContainer show all
Defined in:
lib/tuio-ruby/tuio_cursor.rb

Instance Attribute Summary collapse

Attributes inherited from TuioContainer

#session_id, #x_pos, #y_pos

Attributes inherited from TuioPoint

#updated_at, #x_pos, #y_pos

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TuioContainer

#equal_to_local_args?, #params_equal?, #path, #update, #update_from_params

Methods inherited from TuioPoint

#degrees_to, #distance_to, #eql?, #radians_to, #update

Constructor Details

#initialize(session_id, x_pos, y_pos) ⇒ TuioCursor

Returns a new instance of TuioCursor.



15
16
17
18
19
20
21
# File 'lib/tuio-ruby/tuio_cursor.rb', line 15

def initialize( session_id, x_pos, y_pos )
  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

Returns the value of attribute finger_id.



5
6
7
# File 'lib/tuio-ruby/tuio_cursor.rb', line 5

def finger_id
  @finger_id
end

#motion_accelObject (readonly)

Returns the value of attribute motion_accel.



6
7
8
# File 'lib/tuio-ruby/tuio_cursor.rb', line 6

def motion_accel
  @motion_accel
end

#x_speedObject (readonly)

Returns the value of attribute x_speed.



6
7
8
# File 'lib/tuio-ruby/tuio_cursor.rb', line 6

def x_speed
  @x_speed
end

#y_speedObject (readonly)

Returns the value of attribute y_speed.



6
7
8
# File 'lib/tuio-ruby/tuio_cursor.rb', line 6

def y_speed
  @y_speed
end

Class Method Details

.from_params(params) ⇒ Object



8
9
10
11
12
13
# File 'lib/tuio-ruby/tuio_cursor.rb', line 8

def self.from_params( params )
  new(  params.session_id,
        params.x_pos,
        params.y_pos 
  )
end

Instance Method Details

#equal_to_local_params?(params) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/tuio-ruby/tuio_cursor.rb', line 24

def equal_to_local_params?( params )
  true
end