Class: Ra::Light
- Inherits:
-
Object
- Object
- Ra::Light
- 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
-
#intensity ⇒ Object
Returns the value of attribute intensity.
-
#position ⇒ Object
Returns the value of attribute position.
Instance Method Summary collapse
-
#initialize(intensity:, position:) ⇒ Light
constructor
A new instance of Light.
Constructor Details
#initialize(intensity:, position:) ⇒ Light
Returns a new instance of Light.
16 17 18 19 |
# File 'lib/ra/light.rb', line 16 def initialize(intensity:, position:) @intensity = intensity @position = position end |
Instance Attribute Details
#intensity ⇒ Object
Returns the value of attribute intensity.
12 13 14 |
# File 'lib/ra/light.rb', line 12 def intensity @intensity end |
#position ⇒ Object
Returns the value of attribute position.
12 13 14 |
# File 'lib/ra/light.rb', line 12 def position @position end |