summaryrefslogtreecommitdiffstats
path: root/balls.cl
diff options
context:
space:
mode:
Diffstat (limited to 'balls.cl')
-rw-r--r--balls.cl10
1 files changed, 5 insertions, 5 deletions
diff --git a/balls.cl b/balls.cl
index 4fdc900..164ef4a 100644
--- a/balls.cl
+++ b/balls.cl
@@ -37,8 +37,8 @@ collideWalls(__global float2 *positions, __global float2 *velocities, __global f
r = radii[id];
/* Set bounds. */
- min = -1.0f + r + FLT_EPSILON;
- max = 1.0f - r - FLT_EPSILON;
+ min = -1.0f + r;
+ max = 1.0f - r;
/* Check for collision with bounds. */
if (p.x <= min.x || p.x >= max.x) {
@@ -114,7 +114,7 @@ isCollision(float2 p1, float r1, float2 p2, float r2) {
float rhs;
dist = p1 - p2;
- rhs = r1 + r2 + FLT_EPSILON;
+ rhs = r1 + r2;
return (dist.x*dist.x + dist.y*dist.y) <= rhs*rhs;
}
@@ -125,8 +125,8 @@ setPosition(float2 *p1, float r1, float2 *p2, float r2) {
mid = (*p1 + *p2) / 2.0f;
n = unitNorm(*p2 - *p1);
- *p1 = mid - (n*r1 + FLT_EPSILON);
- *p2 = mid + (n*r2 + FLT_EPSILON);
+ *p1 = mid - n*r1;
+ *p2 = mid + n*r2;
}
/* Set the velocities of two balls after collision. */