lib/cyberarm_engine/model.rb in cyberarm_engine-0.23.0 vs lib/cyberarm_engine/model.rb in cyberarm_engine-0.24.0
- old
+ new
@@ -47,12 +47,13 @@
populate_vertex_buffer
configure_vao
@objects.each { |o| @vertex_count += o.vertices.size }
- start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)
+ # start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)
# build_collision_tree
+ # puts " Building mesh collision tree took #{((Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) - start_time) / 1000.0).round(2)} seconds"
end
def parse(parser)
parser.new(self).parse
end
@@ -148,37 +149,37 @@
# index, size, type, normalized, stride, pointer
# vertices (positions)
glBindBuffer(GL_ARRAY_BUFFER, @positions_buffer_id)
gl_error?
- # inPosition
+ # in_position
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nil)
gl_error?
# colors
glBindBuffer(GL_ARRAY_BUFFER, @colors_buffer_id)
- # inColor
+ # in_color
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, nil)
gl_error?
# normals
glBindBuffer(GL_ARRAY_BUFFER, @normals_buffer_id)
- # inNormal
+ # in_normal
glVertexAttribPointer(2, 4, GL_FLOAT, GL_FALSE, 0, nil)
gl_error?
if has_texture?
# uvs
glBindBuffer(GL_ARRAY_BUFFER, @uvs_buffer_id)
- # inUV
+ # in_uv
glVertexAttribPointer(3, 3, GL_FLOAT, GL_FALSE, 0, nil)
gl_error?
end
glBindBuffer(GL_ARRAY_BUFFER, 0)
glBindVertexArray(0)
end
def build_collision_tree
- @aabb_tree = AABBTree.new
+ @aabb_tree = IMICFPS::AABBTree.new
@faces.each do |face|
box = BoundingBox.new
box.min = face.vertices.first.dup
box.max = face.vertices.first.dup