Sha256: a12c33aef88f182f6e46c3dd9622dc910fd3e502e8e70a208a6729cee6ee8991

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

module Mittsu
  class Light
    attr_accessor :camera_helper

    # def initialize(light, renderer)
    #   super
    #   @light = light
    #   @light_renderer = renderer.light_renderer
    #
    #
    #   @_direction = Vector3.new
    #   @_vector3 = Vector3.new
    # end

    def type
      self.class::TYPE
    end

    def setup(light_renderer)
      @light_renderer = light_renderer
      @cache ||= @light_renderer.cache[type]
      @cache.count += 1

      return unless visible

      @_direction ||= Vector3.new
      @_vector3 ||= Vector3.new

      setup_specific(@cache.length)

      @cache.length += 1
    end

    def project(renderer)
      @renderer = renderer
      return unless visible
      init
      # TODO!!! FIXME!!!
      @renderer.instance_variable_get(:@lights) << self
      project_children
    end

    def self.null_remaining_lights(cache, colors = nil)
      colors ||= cache.colors
      count = [colors.length, cache.count * 3].max
      (cache.length * 3).upto(count - 1).each { |i|
        colors[i] = 0.0
      }
    end

    def to_sym
      :other
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
mittsu-opengl-0.5.1 lib/mittsu/opengl_implementation/lights/light.rb
mittsu-0.4.1 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-opengl-0.5.0 lib/mittsu/opengl_implementation/lights/light.rb
mittsu-0.4.0 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.3.3 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.3.2 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.3.1 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.3.0 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.2.4 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.2.3 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.2.2 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.2.1 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.2.0 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.1.7 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.1.6 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.1.5 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.1.4 lib/mittsu/renderers/opengl/lights/light.rb
mittsu-0.1.3 lib/mittsu/renderers/opengl/lights/light.rb