Class: Stagecraft::Renderer::RenderList

Inherits:
Object
  • Object
show all
Defined in:
lib/stagecraft/renderer/render_list.rb

Defined Under Namespace

Classes: Item

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scene, camera) ⇒ RenderList

Returns a new instance of RenderList.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/stagecraft/renderer/render_list.rb', line 10

def initialize(scene, camera)
  @opaque = []
  @transparent = []
  @lights = []
  @ambient = Larb::Vec3.new
  @culled_count = 0
  @camera = camera
  @frustum = Bounding::Frustum.from_matrix(camera.view_projection_matrix)
  collect(scene, true)
  sort!
end

Instance Attribute Details

#ambientObject (readonly)

Returns the value of attribute ambient.



8
9
10
# File 'lib/stagecraft/renderer/render_list.rb', line 8

def ambient
  @ambient
end

#culled_countObject (readonly)

Returns the value of attribute culled_count.



8
9
10
# File 'lib/stagecraft/renderer/render_list.rb', line 8

def culled_count
  @culled_count
end

#lightsObject (readonly)

Returns the value of attribute lights.



8
9
10
# File 'lib/stagecraft/renderer/render_list.rb', line 8

def lights
  @lights
end

#opaqueObject (readonly)

Returns the value of attribute opaque.



8
9
10
# File 'lib/stagecraft/renderer/render_list.rb', line 8

def opaque
  @opaque
end

#transparentObject (readonly)

Returns the value of attribute transparent.



8
9
10
# File 'lib/stagecraft/renderer/render_list.rb', line 8

def transparent
  @transparent
end

Instance Method Details

#itemsObject



22
23
24
# File 'lib/stagecraft/renderer/render_list.rb', line 22

def items
  [*opaque, *transparent]
end