diff options
Diffstat (limited to 'balls.h')
| -rw-r--r-- | balls.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,7 +1,9 @@ -typedef float float2 __attribute__ ((vector_size (2*sizeof(float)))); +typedef struct { + int x, y; +} Vector; typedef struct { - float2 min, max; + Vector min, max; } Rectangle; /* @@ -21,9 +23,8 @@ Partition partitionCollisions(size_t nBalls); void freePartition(Partition part); void printPartition(Partition part); -int isCollision(float2 p1, float r1, float2 p2, float r2); +int isCollision(Vector p1, float r1, Vector p2, float r2); Rectangle insetRect(Rectangle r, float n); float randFloat(float lo, float hi); -float2 randPtInRect(Rectangle r); -float2 randVec(float xmin, float xmax, float ymin, float ymax); +Vector randPtInRect(Rectangle r); |