Sha256: b75c7c271aae02308c3749f0cf26138b1a6ad9653df7ee28fb7279c1ffe888d1
Contents?: true
Size: 853 Bytes
Versions: 2
Compression:
Stored size: 853 Bytes
Contents
module Mittsu class PointLight TYPE = :point class Cache < Struct.new(:length, :count, :colors, :distances, :positions, :decays) def initialize super(0, 0, [], [], [], []) end def reset self.length = 0 end end def setup_specific(index) offset = index * 3; OpenGL::Helper.set_color_linear(@cache.colors, offset, color, intensity) @_vector3.set_from_matrix_position(matrix_world) positions = @cache.positions positions[offset] = @_vector3.x positions[offset + 1] = @_vector3.y positions[offset + 2] = @_vector3.z # distance is 0 if decay is 0, because there is no attenuation at all. @cache.distances[index] = distance @cache.decays[index] = distance.zero? ? 0.0 : decay end def to_sym :point end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mittsu-opengl-0.5.1 | lib/mittsu/opengl_implementation/lights/point_light.rb |
mittsu-opengl-0.5.0 | lib/mittsu/opengl_implementation/lights/point_light.rb |