Class: Collada::Parser::VisualScene
- Inherits:
-
Object
- Object
- Collada::Parser::VisualScene
- Defined in:
- lib/collada/parser/scene.rb,
lib/collada/parser/visual_scene.rb
Defined Under Namespace
Classes: ControllerInstance, GeometryInstance, Node, NodeReference
Constant Summary collapse
- INSTANCE_ELEMENTS =
[ ['instance_geometry', GeometryInstance], ['instance_controller', ControllerInstance], ]
Instance Attribute Summary collapse
-
#named ⇒ Object
readonly
Returns the value of attribute named.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Class Method Summary collapse
Instance Method Summary collapse
- #[](id) ⇒ Object
-
#initialize(nodes) ⇒ VisualScene
constructor
A new instance of VisualScene.
- #traverse(nodes = @nodes, &block) ⇒ Object
Constructor Details
#initialize(nodes) ⇒ VisualScene
Returns a new instance of VisualScene.
221 222 223 |
# File 'lib/collada/parser/scene.rb', line 221 def initialize(nodes = []) @nodes = nodes end |
Instance Attribute Details
#named ⇒ Object (readonly)
Returns the value of attribute named.
189 190 191 |
# File 'lib/collada/parser/visual_scene.rb', line 189 def named @named end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
225 226 227 |
# File 'lib/collada/parser/scene.rb', line 225 def nodes @nodes end |
Class Method Details
Instance Method Details
#[](id) ⇒ Object
191 192 193 |
# File 'lib/collada/parser/visual_scene.rb', line 191 def [] (id) @named[id] end |
#traverse(nodes = @nodes, &block) ⇒ Object
201 202 203 204 205 206 207 208 209 |
# File 'lib/collada/parser/visual_scene.rb', line 201 def traverse(nodes = @nodes, &block) nodes.each do |node| catch(:pass) do yield node traverse(node.children, &block) end end end |