Class: Three::Fog
Direct Known Subclasses
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#far ⇒ Object
Returns the value of attribute far.
-
#name ⇒ Object
Returns the value of attribute name.
-
#near ⇒ Object
Returns the value of attribute near.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(color = 0xffffff, near: 1, far: 1000, name: "") ⇒ Fog
constructor
A new instance of Fog.
- #to_h ⇒ Object
Methods included from Dirty
#add_dirty_dependent, #dirty?, #dirty_dependents, #dirty_field?, #dirty_fields, #mark_clean!, #mark_dirty!, #remove_dirty_dependent
Constructor Details
#initialize(color = 0xffffff, near: 1, far: 1000, name: "") ⇒ Fog
Returns a new instance of Fog.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/three/scenes/fog.rb', line 13 def initialize(color = 0xffffff, near: 1, far: 1000, name: "") @uuid = MathUtils.generate_uuid @type = "Fog" @name = name @color = color.is_a?(Color) ? color : Color.new(color) @near = near @far = far bind_color_changes mark_dirty! end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
11 12 13 |
# File 'lib/three/scenes/fog.rb', line 11 def color @color end |
#far ⇒ Object
Returns the value of attribute far.
11 12 13 |
# File 'lib/three/scenes/fog.rb', line 11 def far @far end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/three/scenes/fog.rb', line 11 def name @name end |
#near ⇒ Object
Returns the value of attribute near.
11 12 13 |
# File 'lib/three/scenes/fog.rb', line 11 def near @near end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11 12 13 |
# File 'lib/three/scenes/fog.rb', line 11 def type @type end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
11 12 13 |
# File 'lib/three/scenes/fog.rb', line 11 def uuid @uuid end |
Instance Method Details
#to_h ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/three/scenes/fog.rb', line 45 def to_h { type: @type, name: @name, color: @color.hex, near: @near, far: @far } end |