summaryrefslogtreecommitdiffstats
path: root/balls.h
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-10-28 10:34:43 -0400
committerSam Anthony <sam@samanthony.xyz>2024-10-28 10:34:43 -0400
commit5b560599f951cec1d88f86824912bc5241fe6d08 (patch)
tree23769f71d5b8d3607cce85a1deb89ba5ad07e1fc /balls.h
parent245fcc0a20772c42cceb51288d4e48c5edac147b (diff)
downloadballs-5b560599f951cec1d88f86824912bc5241fe6d08.zip
set initial positions
Diffstat (limited to 'balls.h')
-rw-r--r--balls.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/balls.h b/balls.h
new file mode 100644
index 0000000..7c9a8ca
--- /dev/null
+++ b/balls.h
@@ -0,0 +1,9 @@
+typedef float float2 __attribute__ ((vector_size (2*sizeof(float))));
+
+typedef struct {
+ float2 min, max;
+} Rectangle;
+
+int isCollision(float2 p1, float r1, float2 p2, float r2);
+Rectangle insetRect(Rectangle r, float n);
+float2 randPtInRect(Rectangle r);