Removed global state for LightManager and ObjectManager, they're now inside GameState. Simplified terrain mesh.

This commit is contained in:
2019-02-07 10:05:43 -06:00
parent 2f0cb47ed8
commit f4a81f1e36
16 changed files with 28104 additions and 144520 deletions

View File

@@ -5,13 +5,15 @@ class IMICFPS
attr_reader :opengl_renderer, :bounding_box_renderer
def initialize
@bounding_box_renderer = BoundingBoxRenderer.new
def initialize(game_state:)
@game_state = game_state
@bounding_box_renderer = BoundingBoxRenderer.new(game_state: game_state)
@opengl_renderer = OpenGLRenderer.new
end
def draw
ObjectManager.objects.each do |object|
@game_state.game_objects.each do |object|
if object.visible && object.renderable
# Render bounding boxes before transformation is applied
@bounding_box_renderer.create_bounding_box(object, object.model.bounding_box, object.debug_color, object.object_id) if $debug