Fixed bounding box rendering! fixed AABB collision detection (was a bit weird), misc. tweaks and fixes.

This commit is contained in:
2018-12-09 21:17:12 -06:00
parent a5b2ab7992
commit 7271c0e4a1
9 changed files with 175 additions and 90 deletions

View File

@@ -11,16 +11,20 @@ class IMICFPS
end
def draw
@bounding_box_renderer.draw_bounding_boxes if $debug
$window.number_of_faces+=@bounding_box_renderer.bounding_boxes[:vertices].size/3 if $debug
@bounding_box_renderer.bounding_boxes.clear
ObjectManager.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
object.model.objects.each {|o| @bounding_box_renderer.create_bounding_box(object, o.bounding_box, o.debug_color, o.object_id)} if $debug
@opengl_renderer.draw_object(object)
end
end
@bounding_box_renderer.draw_bounding_boxes if $debug
$window.number_of_faces+=$window.number_of_faces if $debug
$window.number_of_faces+=@bounding_box_renderer.vertex_count/3 if $debug
# @bounding_box_renderer.bounding_boxes.clear
end
def handleGlError
@@ -34,4 +38,4 @@ class IMICFPS
def finalize # cleanup
end
end
end
end