This commit is contained in:
Masashi 2025-12-20 15:09:29 +05:30
commit 0c0cfef186
28 changed files with 220 additions and 331 deletions

25
game/inc/suic_math.h Normal file
View file

@ -0,0 +1,25 @@
#pragma once
#include <stdbool.h>
/**
* Vector3 math utilities for game code.
* Designed to be callable from .sui via transpiler bindings.
*/
typedef struct SuicVec3 {
float x, y, z;
} SuicVec3;
/* Construction */
SuicVec3 suic_v3(float x, float y, float z);
/* Arithmetic */
SuicVec3 suic_v3_add(SuicVec3 a, SuicVec3 b);
SuicVec3 suic_v3_sub(SuicVec3 a, SuicVec3 b);
SuicVec3 suic_v3_mul(SuicVec3 a, float s);
/* Dot/Length/Normalize */
float suic_v3_dot(SuicVec3 a, SuicVec3 b);
float suic_v3_len(SuicVec3 a);
SuicVec3 suic_v3_norm(SuicVec3 a);
SuicVec3 suic_v3_normalize(SuicVec3 v);