diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-10-31 19:53:25 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-10-31 19:53:25 -0400 |
| commit | 111013b9ecb8b4208bfb1109e0f8ce8291fc90df (patch) | |
| tree | db67132d08569ade41c50b9e8948df3b094095d0 /balls.h | |
| parent | 8a3994c5f6fd7023b5bdff9a02bc1f0ba110f12f (diff) | |
| download | balls-111013b9ecb8b4208bfb1109e0f8ce8291fc90df.zip | |
remove gcc vector with struct
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); |