big refactor

This commit is contained in:
2025-04-11 22:01:30 +02:00
parent 68412a7d7a
commit 928842c4c2
42 changed files with 1429 additions and 3312 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef VECTOR_H
#define VECTOR_H
typedef struct {
Vector2 *data;
size_t count;
} Vector2Array;
bool IsVectorZero(Vector2 v) {
float epsilon = 0.01f;
return (fabs(v.x) < epsilon && fabs(v.y) < epsilon);
}
Vector2 GetRandomVector(const Rectangle bounds) {
return (Vector2){
bounds.x + (float)GetRandomValue(0, 10000) / 10000.0f * bounds.width,
bounds.y + (float)GetRandomValue(0, 10000) / 10000.0f * bounds.height
};
}
#endif // VECTOR_H