Class: Three::FogExp2

Inherits:
Fog
  • Object
show all
Defined in:
lib/three/scenes/fog.rb

Instance Attribute Summary collapse

Attributes inherited from Fog

#color, #far, #name, #near, #type, #uuid

Instance Method Summary collapse

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, density: 0.00025, name: "") ⇒ FogExp2

Returns a new instance of FogExp2.



65
66
67
68
69
70
# File 'lib/three/scenes/fog.rb', line 65

def initialize(color = 0xffffff, density: 0.00025, name: "")
  super(color, near: nil, far: nil, name: name)
  @type = "FogExp2"
  @density = density
  mark_dirty!
end

Instance Attribute Details

#densityObject

Returns the value of attribute density.



63
64
65
# File 'lib/three/scenes/fog.rb', line 63

def density
  @density
end

Instance Method Details

#to_hObject



77
78
79
80
81
82
83
84
# File 'lib/three/scenes/fog.rb', line 77

def to_h
  {
    type: @type,
    name: name,
    color: color.hex,
    density: @density
  }
end