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