Method: CyberarmEngine::Light#initialize

Defined in:
lib/cyberarm_engine/opengl/light.rb

#initialize(id:, type: Light::POINT, ambient: Vector.new(0.5, 0.5, 0.5), diffuse: Vector.new(1, 1, 1), specular: Vector.new(0.2, 0.2, 0.2), position: Vector.new(0, 0, 0), direction: Vector.new(0, 0, 0), intensity: 1) ⇒ Light

Returns a new instance of Light.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/cyberarm_engine/opengl/light.rb', line 12

def initialize(
  id:,
  type: Light::POINT,
  ambient: Vector.new(0.5, 0.5, 0.5),
  diffuse: Vector.new(1, 1, 1),
  specular: Vector.new(0.2, 0.2, 0.2),
  position: Vector.new(0, 0, 0),
  direction: Vector.new(0, 0, 0),
  intensity: 1
)
  @light_id = id
  @type = type

  @ambient  = ambient
  @diffuse  = diffuse
  @specular = specular
  @position = position
  @direction = direction

  @intensity = intensity
end