Class: Mittsu::MeshFaceMaterial
- Inherits:
-
Object
- Object
- Mittsu::MeshFaceMaterial
- Defined in:
- lib/mittsu/materials/mesh_face_material.rb
Instance Attribute Summary collapse
-
#materials ⇒ Object
readonly
Returns the value of attribute materials.
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(materials = []) ⇒ MeshFaceMaterial
constructor
A new instance of MeshFaceMaterial.
- #to_json ⇒ Object
Constructor Details
#initialize(materials = []) ⇒ MeshFaceMaterial
Returns a new instance of MeshFaceMaterial.
7 8 9 10 11 |
# File 'lib/mittsu/materials/mesh_face_material.rb', line 7 def initialize(materials = []) @uuid = SecureRandom.uuid @type = 'MeshFaceMaterial' @materials = materials end |
Instance Attribute Details
#materials ⇒ Object (readonly)
Returns the value of attribute materials.
5 6 7 |
# File 'lib/mittsu/materials/mesh_face_material.rb', line 5 def materials @materials end |
Instance Method Details
#clone ⇒ Object
26 27 28 29 30 |
# File 'lib/mittsu/materials/mesh_face_material.rb', line 26 def clone MeshFaceMaterial.new.tap do |mateiral| material.materials = @materials.map(&:clone) end end |
#to_json ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mittsu/materials/mesh_face_material.rb', line 13 def to_json { metadata: { version: 4.2, type: 'material', generator: 'MaterialExporter' }, uuid: @uuid, type: @type, materials: @materials.map(&:to_json) } end |