Class: Ra::Lighting
- Inherits:
-
Object
- Object
- Ra::Lighting
- Defined in:
- lib/ra/lighting.rb
Overview
Lighting encaspulates a [Phong Reflection Model](en.wikipedia.org/wiki/phong_reflection_model).
Instance Attribute Summary collapse
Instance Method Summary collapse
- #color ⇒ Ra::Color
-
#initialize(light:, surface:, shadowed:) ⇒ Lighting
constructor
A new instance of Lighting.
Constructor Details
#initialize(light:, surface:, shadowed:) ⇒ Lighting
Returns a new instance of Lighting.
21 22 23 24 25 |
# File 'lib/ra/lighting.rb', line 21 def initialize(light:, surface:, shadowed:) @surface = surface @shadowed = shadowed @light = light end |
Instance Attribute Details
#shadowed ⇒ Boolean
12 13 14 |
# File 'lib/ra/lighting.rb', line 12 def shadowed @shadowed end |
Instance Method Details
#color ⇒ Ra::Color
28 29 30 |
# File 'lib/ra/lighting.rb', line 28 def color ambient_color + diffuse_color + specular_color end |