Skip to content

Commit

Permalink
fix collision debug rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Nov 10, 2016
1 parent 810e504 commit bb08803
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/render/draw_collision_debug.js
Expand Up @@ -12,6 +12,8 @@ function drawCollisionDebug(painter, sourceCache, layer, coords) {
const tile = sourceCache.getTile(coord);
const bucket = tile.getBucket(layer);
if (!bucket) continue;
const buffers = bucket.buffers.collisionBox;
if (!buffers) continue;

gl.uniformMatrix4fv(program.u_matrix, false, coord.posMatrix);

Expand All @@ -22,7 +24,6 @@ function drawCollisionDebug(painter, sourceCache, layer, coords) {
gl.uniform1f(program.u_zoom, painter.transform.zoom * 10);
gl.uniform1f(program.u_maxzoom, (tile.coord.z + 1) * 10);

const buffers = bucket.buffers.collisionBox;
for (const segment of buffers.segments) {
segment.vaos[layer.id].bind(gl, program, buffers.layoutVertexBuffer, buffers.elementBuffer, null, segment.vertexOffset);
gl.drawElements(gl.LINES, segment.primitiveLength * 2, gl.UNSIGNED_SHORT, segment.primitiveOffset * 2 * 2);
Expand Down

0 comments on commit bb08803

Please sign in to comment.