Class: Hate::Graphics::Light

Inherits:
Object
  • Object
show all
Defined in:
lib/hate/graphics/light.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a = [0.5, 0.5, 0.5, 1.0], d = [1.0, 1.0, 1.0, 1.0], p = [0.0, 10.0, 0.0, 1.0]) ⇒ Light

Returns a new instance of Light.



7
8
9
10
11
# File 'lib/hate/graphics/light.rb', line 7

def initialize(a=[0.5, 0.5, 0.5, 1.0], d=[1.0, 1.0, 1.0, 1.0], p=[0.0, 10.0, 0.0, 1.0])
  @ambient  = MemoryPointer.new(:float, 4).put_array_of_float(0, a)
  @diffuse  = MemoryPointer.new(:float, 4).put_array_of_float(0, d)
  @position = MemoryPointer.new(:float, 4).put_array_of_float(0, p)
end

Instance Attribute Details

#ambientObject

Returns the value of attribute ambient.



5
6
7
# File 'lib/hate/graphics/light.rb', line 5

def ambient
  @ambient
end

#diffuseObject

Returns the value of attribute diffuse.



5
6
7
# File 'lib/hate/graphics/light.rb', line 5

def diffuse
  @diffuse
end

#positionObject

Returns the value of attribute position.



5
6
7
# File 'lib/hate/graphics/light.rb', line 5

def position
  @position
end

Instance Method Details

#runObject



13
14
15
# File 'lib/hate/graphics/light.rb', line 13

def run
  
end