Class: Rgltf::Accessor::Sparse::Indices
- Inherits:
-
Properties::Base
- Object
- Properties::Base
- Rgltf::Accessor::Sparse::Indices
- Defined in:
- lib/rgltf/properties/accessor.rb
Instance Attribute Summary collapse
-
#buffer_view ⇒ Object
readonly
Returns the value of attribute buffer_view.
-
#byte_offset ⇒ Object
readonly
Returns the value of attribute byte_offset.
-
#component_type ⇒ Object
readonly
Returns the value of attribute component_type.
Attributes inherited from Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
-
#initialize(json, document:, accessor_index:) ⇒ Indices
constructor
A new instance of Indices.
Methods inherited from Properties::Base
#extension, #nested_properties, #parse_extensions!
Constructor Details
#initialize(json, document:, accessor_index:) ⇒ Indices
Returns a new instance of Indices.
112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/rgltf/properties/accessor.rb', line 112 def initialize(json, document:, accessor_index:) super(json, document:, owner_type: :accessor_sparse_indices) @buffer_view = document.fetch_reference( :buffer_views, json.fetch('bufferView'), "accessors/#{accessor_index}/sparse/indices/bufferView" ) @byte_offset = json.fetch('byteOffset', 0) type = AccessorReader::COMPONENT_TYPES.fetch(json.fetch('componentType'))[:sym] raise FormatError, 'sparse indices must be unsigned integers' unless %i[u8 u16 u32].include?(type) @component_type = type end |
Instance Attribute Details
#buffer_view ⇒ Object (readonly)
Returns the value of attribute buffer_view.
110 111 112 |
# File 'lib/rgltf/properties/accessor.rb', line 110 def buffer_view @buffer_view end |
#byte_offset ⇒ Object (readonly)
Returns the value of attribute byte_offset.
110 111 112 |
# File 'lib/rgltf/properties/accessor.rb', line 110 def byte_offset @byte_offset end |
#component_type ⇒ Object (readonly)
Returns the value of attribute component_type.
110 111 112 |
# File 'lib/rgltf/properties/accessor.rb', line 110 def component_type @component_type end |