Class: Rgltf::Texture
- Inherits:
-
Properties::Base
- Object
- Properties::Base
- Rgltf::Texture
- Defined in:
- lib/rgltf/properties/texture.rb
Instance Attribute Summary collapse
-
#sampler ⇒ Object
readonly
Returns the value of attribute sampler.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Attributes inherited from Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
-
#initialize(json, document:, index:) ⇒ Texture
constructor
A new instance of Texture.
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
#sampler ⇒ Object (readonly)
Returns the value of attribute sampler.
5 6 7 |
# File 'lib/rgltf/properties/texture.rb', line 5 def sampler @sampler end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'lib/rgltf/properties/texture.rb', line 5 def source @source end |