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:



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

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

Instance Attribute Details

#intensityObject

Returns the value of attribute intensity.



12
13
14
# File 'lib/ra/light.rb', line 12

def intensity
  @intensity
end

#positionObject

Returns the value of attribute position.



12
13
14
# File 'lib/ra/light.rb', line 12

def position
  @position
end