Class: Rgltf::PbrMetallicRoughness
- Inherits:
-
Rgltf::Properties::Base
- Object
- Rgltf::Properties::Base
- Rgltf::PbrMetallicRoughness
- Defined in:
- lib/rgltf/properties/material.rb
Instance Attribute Summary collapse
-
#base_color_factor ⇒ Object
readonly
Returns the value of attribute base_color_factor.
-
#base_color_texture ⇒ Object
readonly
Returns the value of attribute base_color_texture.
-
#metallic_factor ⇒ Object
readonly
Returns the value of attribute metallic_factor.
-
#metallic_roughness_texture ⇒ Object
readonly
Returns the value of attribute metallic_roughness_texture.
-
#roughness_factor ⇒ Object
readonly
Returns the value of attribute roughness_factor.
Attributes inherited from Rgltf::Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
-
#initialize(json, document:) ⇒ PbrMetallicRoughness
constructor
A new instance of PbrMetallicRoughness.
- #nested_properties ⇒ Object
Methods inherited from Rgltf::Properties::Base
#extension, #parse_extensions!
Constructor Details
#initialize(json, document:) ⇒ PbrMetallicRoughness
Returns a new instance of PbrMetallicRoughness.
42 43 44 45 46 47 48 49 |
# File 'lib/rgltf/properties/material.rb', line 42 def initialize(json, document:) super(json, document:, owner_type: :pbr_metallic_roughness) @base_color_factor = json.fetch('baseColorFactor', [1.0, 1.0, 1.0, 1.0]).freeze @base_color_texture = texture_info(json['baseColorTexture'], document) @metallic_factor = json.fetch('metallicFactor', 1.0) @roughness_factor = json.fetch('roughnessFactor', 1.0) @metallic_roughness_texture = texture_info(json['metallicRoughnessTexture'], document) end |
Instance Attribute Details
#base_color_factor ⇒ Object (readonly)
Returns the value of attribute base_color_factor.
39 40 41 |
# File 'lib/rgltf/properties/material.rb', line 39 def base_color_factor @base_color_factor end |
#base_color_texture ⇒ Object (readonly)
Returns the value of attribute base_color_texture.
39 40 41 |
# File 'lib/rgltf/properties/material.rb', line 39 def base_color_texture @base_color_texture end |
#metallic_factor ⇒ Object (readonly)
Returns the value of attribute metallic_factor.
39 40 41 |
# File 'lib/rgltf/properties/material.rb', line 39 def @metallic_factor end |
#metallic_roughness_texture ⇒ Object (readonly)
Returns the value of attribute metallic_roughness_texture.
39 40 41 |
# File 'lib/rgltf/properties/material.rb', line 39 def @metallic_roughness_texture end |
#roughness_factor ⇒ Object (readonly)
Returns the value of attribute roughness_factor.
39 40 41 |
# File 'lib/rgltf/properties/material.rb', line 39 def roughness_factor @roughness_factor end |
Instance Method Details
#nested_properties ⇒ Object
51 52 53 |
# File 'lib/rgltf/properties/material.rb', line 51 def nested_properties [base_color_texture, ].compact end |