Class: Rgltf::TextureInfo
- Inherits:
-
Properties::Base
- Object
- Properties::Base
- Rgltf::TextureInfo
- Defined in:
- lib/rgltf/properties/material.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#tex_coord ⇒ Object
readonly
Returns the value of attribute tex_coord.
-
#texture ⇒ Object
readonly
Returns the value of attribute texture.
Attributes inherited from Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
-
#initialize(json, document:, owner_type: :texture_info) ⇒ TextureInfo
constructor
A new instance of TextureInfo.
- #transform ⇒ Object
Methods inherited from Properties::Base
#extension, #nested_properties, #parse_extensions!
Constructor Details
#initialize(json, document:, owner_type: :texture_info) ⇒ TextureInfo
Returns a new instance of TextureInfo.
7 8 9 10 11 12 13 |
# File 'lib/rgltf/properties/material.rb', line 7 def initialize(json, document:, owner_type: :texture_info) super @texture = document.fetch_reference(:textures, json.fetch('index'), 'textureInfo/index') @tex_coord = json.fetch('texCoord', 0) rescue KeyError => e raise FormatError, "invalid textureInfo: #{e.}" end |
Instance Attribute Details
#tex_coord ⇒ Object (readonly)
Returns the value of attribute tex_coord.
5 6 7 |
# File 'lib/rgltf/properties/material.rb', line 5 def tex_coord @tex_coord end |
#texture ⇒ Object (readonly)
Returns the value of attribute texture.
5 6 7 |
# File 'lib/rgltf/properties/material.rb', line 5 def texture @texture end |
Instance Method Details
#transform ⇒ Object
15 16 17 |
# File 'lib/rgltf/properties/material.rb', line 15 def transform extension('KHR_texture_transform') end |