Class: MagicaVoxel::Material
- Defined in:
- lib/magica_voxel/material.rb
Overview
The Chunk type MATL
Constant Summary
Constants inherited from Chunk
Instance Attribute Summary collapse
- #id ⇒ Object readonly
- #properties ⇒ Object readonly
Instance Method Summary collapse
-
#att ⇒ Number
TODO: Att.
-
#flux ⇒ Number
TODO: Flux.
-
#inspect ⇒ Object
:nodoc:.
-
#ior ⇒ Number
Index of Refraction.
-
#plastic? ⇒ TureClass|FalseClass
TODO: Plastic.
-
#roughness ⇒ Number
Roughness.
-
#specular ⇒ Number
Specular.
-
#type ⇒ String
Material Type.
-
#weight ⇒ Number
Weight.
Methods inherited from Chunk
#each, header, #initialize, read
Constructor Details
This class inherits a constructor from MagicaVoxel::Chunk
Instance Attribute Details
#properties ⇒ Object (readonly)
9 10 11 |
# File 'lib/magica_voxel/material.rb', line 9 def properties @properties end |
Instance Method Details
#att ⇒ Number
TODO: Att
61 62 63 |
# File 'lib/magica_voxel/material.rb', line 61 def att @att ||= @properties['_att'].to_f end |
#flux ⇒ Number
TODO: Flux
70 71 72 |
# File 'lib/magica_voxel/material.rb', line 70 def flux @flux ||= @properties['_flux'].to_f end |
#inspect ⇒ Object
:nodoc:
86 87 88 89 90 91 92 93 |
# File 'lib/magica_voxel/material.rb', line 86 def inspect '#<MagicaVoxel::Material ' \ "id=#{id}, type=#{type}, " \ "weight=#{weight}, roughness=#{roughness}, " \ "specular=#{specular}, ior=#{ior}, " \ "att=#{att}, flux=#{flux}, " \ "plastic=#{plastic?}>" end |
#ior ⇒ Number
Index of Refraction
52 53 54 |
# File 'lib/magica_voxel/material.rb', line 52 def ior @ior ||= @properties['_ior'].to_f end |
#plastic? ⇒ TureClass|FalseClass
TODO: Plastic
79 80 81 |
# File 'lib/magica_voxel/material.rb', line 79 def plastic? @properties['_plastic'] == '1' end |
#roughness ⇒ Number
Roughness
34 35 36 |
# File 'lib/magica_voxel/material.rb', line 34 def roughness @roughness ||= @properties['_rough'].to_f end |
#specular ⇒ Number
Specular
43 44 45 |
# File 'lib/magica_voxel/material.rb', line 43 def specular @specular ||= @properties['_spec'].to_f end |
#type ⇒ String
Material Type
16 17 18 |
# File 'lib/magica_voxel/material.rb', line 16 def type @type ||= @properties['_type'][1..-1] end |
#weight ⇒ Number
Weight
25 26 27 |
# File 'lib/magica_voxel/material.rb', line 25 def weight @weight ||= @properties['_weight'].to_f end |