Debug commands now affect game

This commit is contained in:
2019-08-07 17:58:30 -05:00
parent 3e6ff5bd4a
commit 3eb34d023e
10 changed files with 21 additions and 29 deletions

View File

@@ -41,7 +41,7 @@ class IMICFPS
parse
puts "#{@file_path.split('/').last} took #{((Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)-start_time)/1000.0).round(2)} seconds to parse" if $debug
puts "#{@file_path.split('/').last} took #{((Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)-start_time)/1000.0).round(2)} seconds to parse" if $debug.get(:stats)
# allocate_gl_objects
# populate_buffers
@@ -49,7 +49,7 @@ class IMICFPS
@objects.each {|o| @vertex_count+=o.vertices.size}
@objects.each_with_index do |o, i|
puts " Model::Object Name: #{o.name}, Vertices: #{o.vertices.size}" if $debug
puts " Model::Object Name: #{o.name}, Vertices: #{o.vertices.size}" if $debug.get(:stats)
end
window.number_of_vertices+=@vertex_count
@has_texture = false
@@ -130,7 +130,7 @@ class IMICFPS
box.max += Vector.new( 0.1, 0.1, 0.1)
@aabb_tree.insert(face, box)
end
puts @aabb_tree.inspect if $debug
puts @aabb_tree.inspect if $debug.get(:stats)
end
def update

View File

@@ -62,7 +62,7 @@ class IMICFPS
end
end
puts "Total Lines: #{lines}" if $debug
puts "Total Lines: #{lines}" if $debug.get(:stats)
calculate_bounding_box(@vertices, @bounding_box)
@objects.each do |o|
calculate_bounding_box(o.vertices, o.bounding_box)