Sha256: 520b648701823b5f6ece3bfc5d6b13f79e3bdccabcd6b6b20368aef2a8e6b795

Contents?: true

Size: 718 Bytes

Versions: 18

Compression:

Stored size: 718 Bytes

Contents

require 'mittsu/lights/light'

module Mittsu

  class HemisphereLight < Light
    attr_accessor :ground_color, :intensity

    def initialize(sky_color = nil, ground_color = nil, intensity = 1.0)
      super(sky_color)

      @type = 'HemisphereLight'

      @position.set(0.0, 100.0, 0.0)

      @ground_color = Color.new(ground_color)
      @intensity = intensity
    end

    def clone
      light = HemisphereLight.new
      super(light)

      light.ground_color.copy(@ground_color)
      light.intensity = @intensity

      light
    end

    protected

    def jsonify
      data = super
      data[:color] = self.color.get_hex
      data[:ground_color] = self.ground_color.get_hex
      data
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mittsu-0.5.0 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.4.1 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.4.0 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.3.3 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.3.2 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.3.1 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.3.0 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.2.4 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.2.3 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.2.2 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.2.1 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.2.0 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.1.7 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.1.6 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.1.5 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.1.4 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.1.3 lib/mittsu/lights/hemisphere_light.rb
mittsu-0.1.2 lib/mittsu/lights/hemisphere_light.rb