Class: Ra::Light

Inherits:
Object
  • Object
show all
Defined in:
lib/ra/light.rb

Overview

A light has a position within a scene and an intensity it is rendered with. For example:

light = Ra::Light.new(
  intensity: Ra::Color.uniform(0.8),
  position: Vector[0, 0, 0, Ra::Tuple::POINT],
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(intensity:, position:) ⇒ Light

Returns a new instance of Light.

Parameters:



22
23
24
25
# File 'lib/ra/light.rb', line 22

def initialize(intensity:, position:)
  @intensity = intensity
  @position = position
end

Instance Attribute Details

#intensityRa::Color

Returns:



14
15
16
# File 'lib/ra/light.rb', line 14

def intensity
  @intensity
end

#positionVector

Returns:

  • (Vector)


18
19
20
# File 'lib/ra/light.rb', line 18

def position
  @position
end