Skip to content

Commit

Permalink
avoid drawing to long lines in attack visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Aug 16, 2024
1 parent ffa49ac commit 6fd7111
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/EngineGpuKernels/RenderingKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ __global__ void cudaDrawCells(uint64_t timestep, int2 worldSize, float2 rectUppe
drawDisc(imageData, imageSize, cellImagePos, color, cellRadius * 1.4f, cellRadius * 2.0f);

auto const endImagePos = mapWorldPosToImagePos(rectUpperLeft, cell->eventPos, universeImageSize, zoom);
if (isLineVisible(cellImagePos, endImagePos, universeImageSize)) {
if (isLineVisible(cellImagePos, endImagePos, universeImageSize) && Math::length(cell->eventPos - cell->pos) < 10.0f) {
drawLine(cellImagePos, endImagePos, color, imageData, imageSize);
}
}
Expand Down

0 comments on commit 6fd7111

Please sign in to comment.