Sha256: e861b84bc12c97e99e9d4b2ff2fd72406ee927051a36ba2634682ac2c4ad4bac
Contents?: true
Size: 841 Bytes
Versions: 1
Compression:
Stored size: 841 Bytes
Contents
module Mittsu class OpenGLDirectionalLight < OpenGLLight TYPE = :directional class Cache < Struct.new(:length, :count, :colors, :positions) def initialize super(0, 0, [], []) end def reset self.length = 0 end end def setup_specific(index) offset = index * 3 @_direction.set_from_matrix_position(@light.matrix_world) @_vector3.set_from_matrix_position(@light.target.matrix_world) @_direction.sub(@_vector3) @_direction.normalize positions = @cache.positions positions[offset] = @_direction.x positions[offset + 1] = @_direction.y positions[offset + 2] = @_direction.z OpenGLHelper.set_color_linear(@cache.colors, offset, @light.color, @light.intensity) end def to_sym :directional 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_directional_light.rb |