Class: Rgltf::Scene
- Inherits:
-
Properties::Base
- Object
- Properties::Base
- Rgltf::Scene
- Defined in:
- lib/rgltf/properties/scene.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Attributes inherited from Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
-
#initialize(json, document:, index:) ⇒ Scene
constructor
A new instance of Scene.
Methods inherited from Properties::Base
#extension, #nested_properties, #parse_extensions!
Constructor Details
#initialize(json, document:, index:) ⇒ Scene
Returns a new instance of Scene.
7 8 9 10 11 12 |
# File 'lib/rgltf/properties/scene.rb', line 7 def initialize(json, document:, index:) super(json, document:, index:, owner_type: :scene) @nodes = json.fetch('nodes', []).each_with_index.map do |node_index, node_position| document.fetch_reference(:nodes, node_index, "scenes/#{index}/nodes/#{node_position}") end.freeze end |
Instance Attribute Details
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
5 6 7 |
# File 'lib/rgltf/properties/scene.rb', line 5 def nodes @nodes end |