Class: Disp3D::Compass

Inherits:
Object
  • Object
show all
Defined in:
lib/compass.rb

Instance Method Summary collapse

Constructor Details

#initialize(camera) ⇒ Compass

Returns a new instance of Compass.



5
6
7
8
# File 'lib/compass.rb', line 5

def initialize(camera)
  @camera = camera
  @coord_node = NodeCoord.new(nil, Vector3.new(), coord_size)
end

Instance Method Details

#gl_display(current_view) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/compass.rb', line 10

def gl_display current_view
  GL.PushMatrix()
  GL.LoadIdentity()
  GL.Translate(coord_pos.x, coord_pos.y, coord_pos.z)
  @camera.apply_rotate
  @coord_node.draw current_view
  GL.PopMatrix()
end

#updateObject



19
20
21
# File 'lib/compass.rb', line 19

def update
  @coord_node.length = coord_size
end