Class: Rgltf::Skin
- Inherits:
-
Properties::Base
- Object
- Properties::Base
- Rgltf::Skin
- Defined in:
- lib/rgltf/properties/skin.rb
Instance Attribute Summary collapse
-
#inverse_bind_matrices ⇒ Object
readonly
Returns the value of attribute inverse_bind_matrices.
-
#joints ⇒ Object
readonly
Returns the value of attribute joints.
-
#skeleton ⇒ Object
readonly
Returns the value of attribute skeleton.
Attributes inherited from Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
-
#initialize(json, document:, index:) ⇒ Skin
constructor
A new instance of Skin.
Methods inherited from Properties::Base
#extension, #nested_properties, #parse_extensions!
Constructor Details
#initialize(json, document:, index:) ⇒ Skin
Returns a new instance of Skin.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rgltf/properties/skin.rb', line 7 def initialize(json, document:, index:) super(json, document:, index:, owner_type: :skin) @joints = json.fetch('joints').each_with_index.map do |node_index, joint_index| document.fetch_reference(:nodes, node_index, "skins/#{index}/joints/#{joint_index}") end.freeze @inverse_bind_matrices = optional_reference(document, :accessors, json['inverseBindMatrices'], "skins/#{index}/inverseBindMatrices") @skeleton = optional_reference(document, :nodes, json['skeleton'], "skins/#{index}/skeleton") rescue KeyError => e raise FormatError, "invalid skin #{index}: #{e.}" end |
Instance Attribute Details
#inverse_bind_matrices ⇒ Object (readonly)
Returns the value of attribute inverse_bind_matrices.
5 6 7 |
# File 'lib/rgltf/properties/skin.rb', line 5 def inverse_bind_matrices @inverse_bind_matrices end |
#joints ⇒ Object (readonly)
Returns the value of attribute joints.
5 6 7 |
# File 'lib/rgltf/properties/skin.rb', line 5 def joints @joints end |
#skeleton ⇒ Object (readonly)
Returns the value of attribute skeleton.
5 6 7 |
# File 'lib/rgltf/properties/skin.rb', line 5 def skeleton @skeleton end |