Merge branch 'main' of yibble.dev:bulmanator/ld58

This commit is contained in:
2025-10-05 21:19:14 +01:00
17 changed files with 335 additions and 127 deletions

View File

@@ -1,8 +1,22 @@
#include <math.h>
V2f V2F(F32 x, F32 y) {
V2f result = { x, y };
return result;
}
function V2f V2f_Scale(V2f x, F32 scale) {
return V2F(x.x * scale, x.y * scale);
}
V2f NormaliseV2F(V2f x) {
F32 magnitude = sqrtf((x.x * x.x) + (x.y * x.y));
if(magnitude > 0.0){
F32 inverse = 1.0f/magnitude;
return V2F(x.x*inverse, x.y*inverse);
}
return x;
}
V3f V3F(F32 x, F32 y, F32 z) {
V3f result = { x, y, z };
return result;
@@ -18,11 +32,6 @@ R2f R2F(V2f min, V2f max) {
return result;
}
V2f V2f_Scale(V2f x, F32 s) {
V2f result = { x.x * s, x.y * s };
return result;
}
V3f V3f_Neg(V3f x) {
V3f result = { -x.x, -x.y, -x.z };
return result;