Class: Stagecraft::Lights::ShadowConfig
- Inherits:
-
Data
- Object
- Data
- Stagecraft::Lights::ShadowConfig
- Defined in:
- lib/stagecraft/lights/directional_light.rb
Instance Attribute Summary collapse
-
#extent ⇒ Object
readonly
Returns the value of attribute extent.
-
#far ⇒ Object
readonly
Returns the value of attribute far.
-
#map_size ⇒ Object
readonly
Returns the value of attribute map_size.
-
#near ⇒ Object
readonly
Returns the value of attribute near.
Instance Method Summary collapse
-
#initialize(map_size: 2_048, near: 0.1, far: 100.0, extent: 20.0) ⇒ ShadowConfig
constructor
A new instance of ShadowConfig.
Constructor Details
#initialize(map_size: 2_048, near: 0.1, far: 100.0, extent: 20.0) ⇒ ShadowConfig
Returns a new instance of ShadowConfig.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/stagecraft/lights/directional_light.rb', line 6 def initialize(map_size: 2_048, near: 0.1, far: 100.0, extent: 20.0) super( map_size: Integer(map_size), near: Float(near), far: Float(far), extent: Float(extent) ) raise ArgumentError, "shadow map_size must be positive" unless self.map_size.positive? raise ArgumentError, "shadow far must exceed near" unless self.far > self.near raise ArgumentError, "shadow extent must be positive" unless self.extent.positive? end |
Instance Attribute Details
#extent ⇒ Object (readonly)
Returns the value of attribute extent
5 6 7 |
# File 'lib/stagecraft/lights/directional_light.rb', line 5 def extent @extent end |
#far ⇒ Object (readonly)
Returns the value of attribute far
5 6 7 |
# File 'lib/stagecraft/lights/directional_light.rb', line 5 def far @far end |
#map_size ⇒ Object (readonly)
Returns the value of attribute map_size
5 6 7 |
# File 'lib/stagecraft/lights/directional_light.rb', line 5 def map_size @map_size end |
#near ⇒ Object (readonly)
Returns the value of attribute near
5 6 7 |
# File 'lib/stagecraft/lights/directional_light.rb', line 5 def near @near end |