Class: Disp3D::Node
- Inherits:
-
Object
- Object
- Disp3D::Node
- Defined in:
- lib/node/node.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#instance_id ⇒ Object
readonly
Returns the value of attribute instance_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parents ⇒ Object
readonly
Array of Node.
Instance Method Summary collapse
- #ancestors ⇒ Object
-
#initialize(name = nil) ⇒ Node
constructor
A new instance of Node.
- #post_draw ⇒ Object
- #pre_draw ⇒ Object
Constructor Details
Instance Attribute Details
#instance_id ⇒ Object (readonly)
Returns the value of attribute instance_id.
24 25 26 |
# File 'lib/node/node.rb', line 24 def instance_id @instance_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/node/node.rb', line 23 def name @name end |
#parents ⇒ Object (readonly)
Array of Node
25 26 27 |
# File 'lib/node/node.rb', line 25 def parents @parents end |
Instance Method Details
#ancestors ⇒ Object
46 47 48 49 |
# File 'lib/node/node.rb', line 46 def ancestors rtn_ancestors_ary = [] return ancestors_inner(rtn_ancestors_ary) end |
#post_draw ⇒ Object
42 43 44 |
# File 'lib/node/node.rb', line 42 def post_draw GL.PopMatrix() end |
#pre_draw ⇒ Object
35 36 37 38 39 40 |
# File 'lib/node/node.rb', line 35 def pre_draw GL.PushMatrix() GL.Translate(pre_translate.x, pre_translate.y, pre_translate.z) if(@pre_translate) GL.MultMatrix(@rotate.to_array) if(@rotate) GL.Translate(post_translate.x, post_translate.y, post_translate.z) if(@post_translate) end |