Class: Teien::Event::BaseObject::SyncObject

Inherits:
Object
  • Object
show all
Defined in:
lib/teien/base_object/base_object_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ SyncObject

Returns a new instance of SyncObject.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/teien/base_object/base_object_event.rb', line 33

def initialize(obj)
  @id = obj.id
  @name = obj.name

  @object_info = obj.object_info
  @physics_info = obj.physics_info

  @pos = Vector3D.to_self(obj.get_position())
  @linear_vel = Vector3D.to_self(obj.get_linear_velocity())
  @angular_vel = Vector3D.to_self(obj.get_angular_velocity())
  @quat = Quaternion.to_self(obj.get_rotation())
  @accel = obj.get_acceleration()

  @attached_objects = obj.attached_objects

end

Instance Attribute Details

#accelObject

Returns the value of attribute accel.



29
30
31
# File 'lib/teien/base_object/base_object_event.rb', line 29

def accel
  @accel
end

#angular_velObject

Returns the value of attribute angular_vel.



27
28
29
# File 'lib/teien/base_object/base_object_event.rb', line 27

def angular_vel
  @angular_vel
end

#attached_objectsObject

Returns the value of attribute attached_objects.



31
32
33
# File 'lib/teien/base_object/base_object_event.rb', line 31

def attached_objects
  @attached_objects
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/teien/base_object/base_object_event.rb', line 18

def id
  @id
end

#linear_velObject

Returns the value of attribute linear_vel.



26
27
28
# File 'lib/teien/base_object/base_object_event.rb', line 26

def linear_vel
  @linear_vel
end

#modeObject

Returns the value of attribute mode.



20
21
22
# File 'lib/teien/base_object/base_object_event.rb', line 20

def mode
  @mode
end

#nameObject

Returns the value of attribute name.



19
20
21
# File 'lib/teien/base_object/base_object_event.rb', line 19

def name
  @name
end

#object_infoObject

Returns the value of attribute object_info.



22
23
24
# File 'lib/teien/base_object/base_object_event.rb', line 22

def object_info
  @object_info
end

#physics_infoObject

Returns the value of attribute physics_info.



23
24
25
# File 'lib/teien/base_object/base_object_event.rb', line 23

def physics_info
  @physics_info
end

#posObject

Returns the value of attribute pos.



25
26
27
# File 'lib/teien/base_object/base_object_event.rb', line 25

def pos
  @pos
end

#quatObject

Returns the value of attribute quat.



28
29
30
# File 'lib/teien/base_object/base_object_event.rb', line 28

def quat
  @quat
end

Instance Method Details



50
51
52
# File 'lib/teien/base_object/base_object_event.rb', line 50

def print
  puts @name
end