Class: Three::HemisphereLight

Inherits:
Light show all
Defined in:
lib/three/lights/hemisphere_light.rb

Constant Summary

Constants inherited from Object3D

Object3D::DEFAULT_MATRIX_AUTO_UPDATE, Object3D::DEFAULT_MATRIX_WORLD_AUTO_UPDATE, Object3D::DEFAULT_UP

Instance Attribute Summary collapse

Attributes inherited from Light

#color, #intensity, #shadow_bias, #shadow_map_size, #shadow_normal_bias, #shadow_radius

Attributes inherited from Object3D

#cast_shadow, #children, #id, #layers, #matrix, #matrix_auto_update, #matrix_world, #matrix_world_auto_update, #matrix_world_needs_update, #name, #parent, #position, #quaternion, #receive_shadow, #rotation, #scale, #type, #up, #user_data, #uuid, #visible

Instance Method Summary collapse

Methods inherited from Light

#dispose

Methods inherited from Object3D

#add, allocate_id, #clear, #dirty_dependency_changed, #get_object_by_id, #get_object_by_name, #get_object_by_property, #get_objects_by_property, #get_world_direction, #get_world_position, #get_world_quaternion, #get_world_scale, #mark_descendant_dirty!, #mark_dirty!, #remove, #remove_from_parent, #to_json, #traverse, #traverse_ancestors, #traverse_visible, #update_matrix, #update_matrix_world, #update_world_matrix

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(sky_color = 0xffffff, ground_color = 0xffffff, intensity = 1) ⇒ HemisphereLight

Returns a new instance of HemisphereLight.



9
10
11
12
13
14
# File 'lib/three/lights/hemisphere_light.rb', line 9

def initialize(sky_color = 0xffffff, ground_color = 0xffffff, intensity = 1)
  super(sky_color, intensity)
  @type = "HemisphereLight"
  @ground_color = Color.new(ground_color)
  bind_ground_color_changes
end

Instance Attribute Details

#ground_colorObject

Returns the value of attribute ground_color.



7
8
9
# File 'lib/three/lights/hemisphere_light.rb', line 7

def ground_color
  @ground_color
end

Instance Method Details

#to_hObject



22
23
24
25
26
# File 'lib/three/lights/hemisphere_light.rb', line 22

def to_h
  super.merge(
    ground_color: @ground_color.hex
  )
end