Class: GlimR::OrthoProjection

Inherits:
SceneObject show all
Defined in:
lib/glimr/renderer/orthoprojection.rb

Instance Attribute Summary collapse

Attributes inherited from SceneObject

#children, #drawables, #mtime, #parent, #viewport

Attributes included from EventListener

#event_listeners, #listener_count

Instance Method Summary collapse

Methods inherited from SceneObject

#<<, #absolute_geometry, #absolute_material, #absolute_shader, #absolute_texture, #absolute_transform, #absolute_transform_for_drawing, #add_drawables, #attach, #clone, #default_config, #detach, #detach_self, #initialize, #inspect, #pop_state, #push_state, #remove_drawables, #render, #replace_node, #root, #touch!, #visible

Methods included from Configurable

#default_config, #initialize

Methods included from EventListener

#add_event_listener, #decrement_listener_count, #dispatch_event, #event_root, #increment_listener_count, #initialize, #method_missing, #multicast_event, #process_event, #remove_event_listener

Constructor Details

This class inherits a constructor from GlimR::SceneObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GlimR::EventListener

Instance Attribute Details

#farObject

Returns the value of attribute far.



8
9
10
# File 'lib/glimr/renderer/orthoprojection.rb', line 8

def far
  @far
end

#heightObject

Returns the value of attribute height.



8
9
10
# File 'lib/glimr/renderer/orthoprojection.rb', line 8

def height
  @height
end

#nearObject

Returns the value of attribute near.



8
9
10
# File 'lib/glimr/renderer/orthoprojection.rb', line 8

def near
  @near
end

#widthObject

Returns the value of attribute width.



8
9
10
# File 'lib/glimr/renderer/orthoprojection.rb', line 8

def width
  @width
end

#xObject

Returns the value of attribute x.



8
9
10
# File 'lib/glimr/renderer/orthoprojection.rb', line 8

def x
  @x
end

#yObject

Returns the value of attribute y.



8
9
10
# File 'lib/glimr/renderer/orthoprojection.rb', line 8

def y
  @y
end

Instance Method Details

#apply(x = x, y = y, width = width, height = height) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/glimr/renderer/orthoprojection.rb', line 10

def apply(x=x, y=y, width=width, height=height)
  MatrixMode(PROJECTION)
  LoadIdentity()
  Ortho(x,width, y,height, near,far)
  MatrixMode(MODELVIEW)
  LoadIdentity()
end