Class: Rgltf::Accessor::Sparse::Values

Inherits:
Properties::Base show all
Defined in:
lib/rgltf/properties/accessor.rb

Instance Attribute Summary collapse

Attributes inherited from Properties::Base

#extensions, #extras, #index, #name, #owner_type, #source_json

Instance Method Summary collapse

Methods inherited from Properties::Base

#extension, #nested_properties, #parse_extensions!

Constructor Details

#initialize(json, document:, accessor_index:) ⇒ Values

Returns a new instance of Values.



130
131
132
133
134
135
136
137
138
# File 'lib/rgltf/properties/accessor.rb', line 130

def initialize(json, document:, accessor_index:)
  super(json, document:, owner_type: :accessor_sparse_values)
  @buffer_view = document.fetch_reference(
    :buffer_views,
    json.fetch('bufferView'),
    "accessors/#{accessor_index}/sparse/values/bufferView"
  )
  @byte_offset = json.fetch('byteOffset', 0)
end

Instance Attribute Details

#buffer_viewObject (readonly)

Returns the value of attribute buffer_view.



128
129
130
# File 'lib/rgltf/properties/accessor.rb', line 128

def buffer_view
  @buffer_view
end

#byte_offsetObject (readonly)

Returns the value of attribute byte_offset.



128
129
130
# File 'lib/rgltf/properties/accessor.rb', line 128

def byte_offset
  @byte_offset
end