Class: Mittsu::MeshFaceMaterial
- Inherits:
-
Object
- Object
- Mittsu::MeshFaceMaterial
- Defined in:
- lib/mittsu/materials/mesh_face_material.rb
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.
5 6 7 8 9 |
# File 'lib/mittsu/materials/mesh_face_material.rb', line 5 def initialize(materials = []) @uuid = SecureRandom.uuid @type = 'MeshFaceMaterial' @materials = materials end |
Instance Method Details
#clone ⇒ Object
24 25 26 27 28 |
# File 'lib/mittsu/materials/mesh_face_material.rb', line 24 def clone MeshFaceMaterial.new.tap do |mateiral| material.materials = @materials.map(&:clone) end end |
#to_json ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mittsu/materials/mesh_face_material.rb', line 11 def to_json { metadata: { version: 4.2, type: 'material', generator: 'MaterialExporter' }, uuid: @uuid, type: @type, materials: @materials.map(&:to_json) } end |