From efbb3e5c5315523ab55c7b856785e54db7eaf604 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Wed, 30 Oct 2024 10:15:46 -0400 Subject: collideBalls(): fix ball index array addressing --- balls.cl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'balls.cl') diff --git a/balls.cl b/balls.cl index 05a223b..bca7686 100644 --- a/balls.cl +++ b/balls.cl @@ -65,8 +65,8 @@ collideBalls( float r1, r2, m1, m2; id = get_global_id(0); - i1 = ballIndices[id]; - i2 = ballIndices[id+1]; + i1 = ballIndices[2*id]; + i2 = ballIndices[2*id+1]; p1 = positions[i1]; p2 = positions[i2]; -- cgit v1.2.3