Class: Mittsu::MeshBasicMaterial

Inherits:
Material
  • Object
show all
Defined in:
lib/mittsu/materials/mesh_basic_material.rb

Instance Attribute Summary collapse

Attributes inherited from Material

#alpha_test, #attributes, #blend_dst, #blend_dst_alpha, #blend_equation, #blend_equation_alpha, #blend_src, #blend_src_alpha, #blending, #bump_map, #color_write, #default_attribute_values, #defines, #depth_test, #depth_write, #fragment_shader, #id, #lights, #metal, #morph_normals, #name, #normal_map, #opacity, #overdraw, #polygon_offset, #polygon_offset_factor, #polygon_offset_units, #program, #side, #size_attenuation, #transparent, #type, #uniforms, #uuid, #vertex_shader, #visible, #wrap_around

Instance Method Summary collapse

Methods inherited from Material

#dispose, #needs_update=, #needs_update?, #set_values, #to_json, #update

Methods included from EventDispatcher

#add_event_listener, #dispatch_event, #has_event_listener, #remove_event_listener

Constructor Details

#initialize(parameters = {}) ⇒ MeshBasicMaterial

Returns a new instance of MeshBasicMaterial.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 40

def initialize(parameters = {})
  super()

  @type = 'MeshBasicMaterial'

  @color = Color.new(0xffffff) # emissive

  @map = nil

  @light_map = nil

  @specular_map = nil

  @alpha_map = nil

  @env_map = nil
  @combine = MultiplyOperation
  @reflectivity = 1.0
  @refraction_ratio = 0.98

  @fog = true

  @shading = SmoothShading

  @wireframe = false
  @wireframe_linewidth = 1
  @wireframe_linecap = :round
  @wireframe_linejoin = :round

  @vertex_colors = NoColors

  @skinning = false
  @morph_targets = false

  set_values(parameters)
end

Instance Attribute Details

#alpha_mapObject

Returns the value of attribute alpha_map.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def alpha_map
  @alpha_map
end

#colorObject

Returns the value of attribute color.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def color
  @color
end

#combineObject

Returns the value of attribute combine.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def combine
  @combine
end

#env_mapObject

Returns the value of attribute env_map.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def env_map
  @env_map
end

#fogObject

Returns the value of attribute fog.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def fog
  @fog
end

#light_mapObject

Returns the value of attribute light_map.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def light_map
  @light_map
end

#mapObject

Returns the value of attribute map.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def map
  @map
end

#morph_targetsObject

Returns the value of attribute morph_targets.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def morph_targets
  @morph_targets
end

#reflectivityObject

Returns the value of attribute reflectivity.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def reflectivity
  @reflectivity
end

#refraction_ratioObject

Returns the value of attribute refraction_ratio.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def refraction_ratio
  @refraction_ratio
end

#shadingObject

Returns the value of attribute shading.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def shading
  @shading
end

#skinningObject

Returns the value of attribute skinning.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def skinning
  @skinning
end

#specular_mapObject

Returns the value of attribute specular_map.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def specular_map
  @specular_map
end

#vertex_colorsObject

Returns the value of attribute vertex_colors.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def vertex_colors
  @vertex_colors
end

#wireframeObject

Returns the value of attribute wireframe.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def wireframe
  @wireframe
end

#wireframe_linecapObject

Returns the value of attribute wireframe_linecap.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def wireframe_linecap
  @wireframe_linecap
end

#wireframe_linejoinObject

Returns the value of attribute wireframe_linejoin.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def wireframe_linejoin
  @wireframe_linejoin
end

#wireframe_linewidthObject

Returns the value of attribute wireframe_linewidth.



38
39
40
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 38

def wireframe_linewidth
  @wireframe_linewidth
end

Instance Method Details

#cloneObject



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/mittsu/materials/mesh_basic_material.rb', line 77

def clone
  material = Material.new

  super(material)

  material.color.copy(@color)

  material.map = @map

  material.lightMap = @lightMap

  material.specularMap = @specularMap

  material.alphaMap = @alphaMap

  material.envMap = @envMap
  material.combine = @combine
  material.reflectivity = @reflectivity
  material.refractionRatio = @refractionRatio

  material.fog = @fog

  material.shading = @shading

  material.wireframe = @wireframe
  material.wireframeLinewidth = @wireframeLinewidth
  material.wireframeLinecap = @wireframeLinecap
  material.wireframeLinejoin = @wireframeLinejoin

  material.vertexColors = @vertexColors

  material.skinning = @skinning
  material.morphTargets = @morphTargets

  material
end