Class: Three::ShadowMaterial

Inherits:
Material show all
Defined in:
lib/three/materials/shadow_material.rb

Instance Attribute Summary collapse

Attributes inherited from Material

#blending, #id, #name, #opacity, #side, #transparent, #type, #user_data, #uuid, #vertex_colors, #visible

Instance Method Summary collapse

Methods inherited from Material

allocate_id, #dirty_dependency_changed, #dispose, #needs_update, #needs_update!, #needs_update=, #set_values, #texture_slots, #textures

Methods included from Dirty

#add_dirty_dependent, #dirty?, #dirty_dependents, #dirty_field?, #dirty_fields, #mark_clean!, #mark_dirty!, #remove_dirty_dependent

Methods inherited from EventDispatcher

#add_event_listener, #dispatch_event, #has_event_listener?, #remove_event_listener

Constructor Details

#initialize(parameters = nil) ⇒ ShadowMaterial

Returns a new instance of ShadowMaterial.



10
11
12
13
14
15
16
17
18
19
# File 'lib/three/materials/shadow_material.rb', line 10

def initialize(parameters = nil)
  super(nil)
  @type = "ShadowMaterial"
  @color = Color.new(0x000000)
  @transparent = true
  @fog = true
  bind_color_changes
  set_values(parameters) if parameters
  mark_dirty!
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



8
9
10
# File 'lib/three/materials/shadow_material.rb', line 8

def color
  @color
end

#fogObject

Returns the value of attribute fog.



8
9
10
# File 'lib/three/materials/shadow_material.rb', line 8

def fog
  @fog
end

Instance Method Details

#to_hObject



32
33
34
35
36
37
# File 'lib/three/materials/shadow_material.rb', line 32

def to_h
  super.merge(
    color: @color.hex,
    fog: @fog
  )
end