Class: Stagecraft::Lights::Directional

Inherits:
Light
  • Object
show all
Defined in:
lib/stagecraft/lights/directional_light.rb

Instance Attribute Summary collapse

Attributes inherited from Light

#color, #intensity

Attributes inherited from Node

#cast_shadow, #children, #name, #parent, #position, #receive_shadow, #render_order, #rotation, #scale, #visible, #world_version

Instance Method Summary collapse

Methods inherited from Light

#direction

Methods inherited from Node

#add, #find, #local_matrix, #look_at, #remove, #transform_dirty!, #traverse, #world_matrix, #world_matrix_with_version, #world_position

Constructor Details

#initialize(cast_shadow: false, shadow: ShadowConfig.new) ⇒ Directional

Returns a new instance of Directional.



22
23
24
25
26
# File 'lib/stagecraft/lights/directional_light.rb', line 22

def initialize(cast_shadow: false, shadow: ShadowConfig.new, **)
  super(**)
  self.cast_shadow = cast_shadow
  @shadow = shadow
end

Instance Attribute Details

#shadowObject

Returns the value of attribute shadow.



20
21
22
# File 'lib/stagecraft/lights/directional_light.rb', line 20

def shadow
  @shadow
end