suicmez/game/inc/suic_math.h
2025-12-20 15:09:29 +05:30

25 lines
599 B
C

#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);