Class: Stagecraft::Lights::Light

Inherits:
Node
  • Object
show all
Defined in:
lib/stagecraft/lights/light.rb

Direct Known Subclasses

Ambient, Directional, Point

Instance Attribute Summary collapse

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 Node

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

Constructor Details

#initialize(color: Color.new(1.0), intensity: 1.0) ⇒ Light

Returns a new instance of Light.



8
9
10
11
12
# File 'lib/stagecraft/lights/light.rb', line 8

def initialize(color: Color.new(1.0), intensity: 1.0, **)
  super(**)
  self.color = color
  self.intensity = intensity
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



6
7
8
# File 'lib/stagecraft/lights/light.rb', line 6

def color
  @color
end

#intensityObject

Returns the value of attribute intensity.



6
7
8
# File 'lib/stagecraft/lights/light.rb', line 6

def intensity
  @intensity
end

Instance Method Details

#directionObject



25
26
27
# File 'lib/stagecraft/lights/light.rb', line 25

def direction
  world_matrix.extract_rotation * Larb::Vec3.forward
end