Sha256: 671a92eea909f79bdead4d3596f4b28e87d586dd4488498cdef5a0b044253e3f

Contents?: true

Size: 550 Bytes

Versions: 1

Compression:

Stored size: 550 Bytes

Contents

module Mittsu
  class OpenGLAmbientLight < OpenGLLight
    TYPE = :ambient

    class Cache < Struct.new(:length, :count, :value)
      def initialize
        super(0, 0, [0.0, 0.0, 0.0])
      end

      def reset
        self.length = 0
        self.value[0] = 0.0
        self.value[1] = 0.0
        self.value[2] = 0.0
      end
    end

    def setup_specific(_)
      @cache.value[0] += @light.color.r
      @cache.value[1] += @light.color.g
      @cache.value[2] += @light.color.b
    end

    def self.null_remaining_lights(_); end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mittsu-0.1.2 lib/mittsu/renderers/opengl/lights/opengl_ambient_light.rb