feat: Player controller

This commit is contained in:
2025-10-05 18:05:01 +01:00
parent 98095c907f
commit e20e537e97
9 changed files with 89 additions and 47 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;