class Disp3D::SceneGraph
Attributes
root_node[RW]
Public Class Methods
new()
click to toggle source
# File lib/scene_graph.rb, line 7 def initialize() @root_node = NodeCollection.new() end
Public Instance Methods
add(node)
click to toggle source
# File lib/scene_graph.rb, line 16 def add(node) @root_node.add(node) end
bounding_box()
click to toggle source
# File lib/scene_graph.rb, line 24 def bounding_box return @root_node.box end
center()
click to toggle source
# File lib/scene_graph.rb, line 28 def center bb = self.bounding_box return nil if bb.nil? return bb.center end
gl_display(current_view)
click to toggle source
# File lib/scene_graph.rb, line 11 def gl_display(current_view) NodePathDB.init @root_node.draw(current_view) end
open(&block)
click to toggle source
# File lib/scene_graph.rb, line 20 def open(&block) @root_node.open(&block) end
radius()
click to toggle source
# File lib/scene_graph.rb, line 34 def radius bb = self.bounding_box return 0 if bb.nil? length = bb.length orth_length = Math.sqrt( length[0]*length[0] + length[1]*length[1] + length[2]*length[2] ) orth_length/2.0 end