Class: Mittsu::AreaLight

Inherits:
Light show all
Defined in:
lib/mittsu/lights/area_light.rb

Constant Summary

Constants inherited from Object3D

Object3D::DefaultUp

Instance Attribute Summary collapse

Attributes inherited from Light

#color, #distance, #only_shadow

Attributes inherited from Object3D

#cast_shadow, #children, #frustum_culled, #geometry, #id, #matrix, #matrix_auto_update, #matrix_world, #matrix_world_needs_update, #name, #parent, #position, #quaternion, #receive_shadow, #render_order, #rotation, #rotation_auto_update, #scale, #type, #up, #user_data, #uuid, #visible

Instance Method Summary collapse

Methods inherited from Light

#clone

Methods inherited from Object3D

#add, #apply_matrix, #clone, #get_object_by_id, #get_object_by_name, #get_object_by_property, #get_world_direction, #get_world_position, #get_world_quaternion, #get_world_rotation, #get_world_scale, #local_to_world, #look_at, #print_tree, #raycast, #remove, #rotate_on_axis, #rotate_x, #rotate_y, #rotate_z, #set_rotation_from_axis_angle, #set_rotation_from_euler, #set_rotation_from_matrix, #set_rotation_from_quaternion, #to_json, #to_s, #translate_on_axis, #translate_x, #translate_y, #translate_z, #traverse, #traverse_ancestors, #traverse_visible, #update_matrix, #update_matrix_world, #world_to_local

Methods included from EventDispatcher

#add_event_listener, #dispatch_event, #has_event_listener, #remove_event_listener

Constructor Details

#initialize(color = nil, intensity = 1.0) ⇒ AreaLight

Returns a new instance of AreaLight.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/mittsu/lights/area_light.rb', line 7

def initialize(color = nil, intensity = 1.0)
  super(color)
  @type = 'AreaLight'

  @normal = Vector3.new(0.0, -1.0, 0.0)
  @right = Vector3.new(1.0, 0.0, 0.0)

  @intensity = intensity

  @width = 1.0
  @height = 1.0

  @constant_attenuation = 1.5
  @linear_attenuation = 0.5
  @quadratic_attenuation = 0.1
end

Instance Attribute Details

#constant_attenuationObject

Returns the value of attribute constant_attenuation.



5
6
7
# File 'lib/mittsu/lights/area_light.rb', line 5

def constant_attenuation
  @constant_attenuation
end

#heightObject

Returns the value of attribute height.



5
6
7
# File 'lib/mittsu/lights/area_light.rb', line 5

def height
  @height
end

#intensityObject

Returns the value of attribute intensity.



5
6
7
# File 'lib/mittsu/lights/area_light.rb', line 5

def intensity
  @intensity
end

#linear_attenuationObject

Returns the value of attribute linear_attenuation.



5
6
7
# File 'lib/mittsu/lights/area_light.rb', line 5

def linear_attenuation
  @linear_attenuation
end

#normalObject

Returns the value of attribute normal.



5
6
7
# File 'lib/mittsu/lights/area_light.rb', line 5

def normal
  @normal
end

#quadratic_attenuationObject

Returns the value of attribute quadratic_attenuation.



5
6
7
# File 'lib/mittsu/lights/area_light.rb', line 5

def quadratic_attenuation
  @quadratic_attenuation
end

#rightObject

Returns the value of attribute right.



5
6
7
# File 'lib/mittsu/lights/area_light.rb', line 5

def right
  @right
end

#widthObject

Returns the value of attribute width.



5
6
7
# File 'lib/mittsu/lights/area_light.rb', line 5

def width
  @width
end