Class: TuioObject
Instance Attribute Summary collapse
-
#angle ⇒ Object
readonly
Returns the value of attribute angle.
-
#fiducial_id ⇒ Object
readonly
Returns the value of attribute fiducial_id.
-
#rotation_accel ⇒ Object
readonly
Returns the value of attribute rotation_accel.
-
#rotation_speed ⇒ Object
readonly
Returns the value of attribute rotation_speed.
Attributes included from TuioContainer
#motion_accel, #session_id, #x_pos, #x_speed, #y_pos, #y_speed
Instance Method Summary collapse
- #args_equal?(args) ⇒ Boolean
-
#initialize(session_id, fiducial_id, x_pos, y_pos, angle) ⇒ TuioObject
constructor
A new instance of TuioObject.
- #inspect ⇒ Object
- #to_args ⇒ Object
- #update(x_pos, y_pos, angle, x_speed, y_speed, rotation_speed, motion_accel, rotation_accel) ⇒ Object
Methods included from TuioContainer
Constructor Details
#initialize(session_id, fiducial_id, x_pos, y_pos, angle) ⇒ TuioObject
Returns a new instance of TuioObject.
8 9 10 11 12 13 14 15 16 |
# File 'lib/tuio_object.rb', line 8 def initialize( session_id, fiducial_id, x_pos, y_pos, angle ) super( session_id, x_pos, y_pos ) @fiducial_id = fiducial_id @angle = angle @rotation_speed = 0.0 @rotation_accel = 0.0 end |
Instance Attribute Details
#angle ⇒ Object (readonly)
Returns the value of attribute angle.
4 5 6 |
# File 'lib/tuio_object.rb', line 4 def angle @angle end |
#fiducial_id ⇒ Object (readonly)
Returns the value of attribute fiducial_id.
4 5 6 |
# File 'lib/tuio_object.rb', line 4 def fiducial_id @fiducial_id end |
#rotation_accel ⇒ Object (readonly)
Returns the value of attribute rotation_accel.
4 5 6 |
# File 'lib/tuio_object.rb', line 4 def rotation_accel @rotation_accel end |
#rotation_speed ⇒ Object (readonly)
Returns the value of attribute rotation_speed.
4 5 6 |
# File 'lib/tuio_object.rb', line 4 def rotation_speed @rotation_speed end |
Instance Method Details
#args_equal?(args) ⇒ Boolean
26 27 28 29 30 31 |
# File 'lib/tuio_object.rb', line 26 def args_equal?( args ) fiducial_id == args[1] && rotation_speed.approx_equal?( args[7] ) && rotation_accel.approx_equal?( args[9] ) && super( args_to_container_from_object( args ) ) end |
#inspect ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/tuio_object.rb', line 46 def inspect puts "TuioObject:" puts "session_id >> #{session_id}" puts "fiducial_id >> #{fiducial_id}" puts "x_pos >> #{x_pos}" puts "y_pos >> #{y_pos}" puts "angle >> #{angle}" puts "x_speed >> #{x_speed}" puts "y_speed >> #{y_speed}" puts "rotation_speed >> #{rotation_speed}" puts "motion_accel >> #{motion_accel}" puts "rotation_accel >> #{rotation_accel}" end |
#to_args ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/tuio_object.rb', line 33 def to_args [ session_id, fiducial_id, x_pos, y_pos, angle, x_speed, y_speed, rotation_speed, motion_accel, rotation_accel] end |
#update(x_pos, y_pos, angle, x_speed, y_speed, rotation_speed, motion_accel, rotation_accel) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/tuio_object.rb', line 18 def update( x_pos, y_pos, angle, x_speed, y_speed, rotation_speed, motion_accel, rotation_accel ) super( x_pos, y_pos, x_speed, y_speed, motion_accel ) @angle = angle @rotation_speed = rotation_speed @rotation_accel = rotation_accel end |