Class: Rgltf::Texture

Inherits:
Properties::Base show all
Defined in:
lib/rgltf/properties/texture.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:, index:) ⇒ Texture

Returns a new instance of Texture.



7
8
9
10
11
# File 'lib/rgltf/properties/texture.rb', line 7

def initialize(json, document:, index:)
  super(json, document:, index:, owner_type: :texture)
  @sampler = optional_reference(document, :samplers, json['sampler'], "textures/#{index}/sampler")
  @source = optional_reference(document, :images, json['source'], "textures/#{index}/source")
end

Instance Attribute Details

#samplerObject (readonly)

Returns the value of attribute sampler.



5
6
7
# File 'lib/rgltf/properties/texture.rb', line 5

def sampler
  @sampler
end

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/rgltf/properties/texture.rb', line 5

def source
  @source
end