ARC_FObround added

This commit is contained in:
herbglitch 2023-06-25 22:14:32 -06:00
parent c3361f640c
commit 5aede928d8
7 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,19 @@
#include "arc/math/obround.h"
ARC_FObround ARC_Obround_CastToFObround(ARC_Obround *obround){
return (ARC_FObround){
.x = (float)obround->x,
.y = (float)obround->y,
.r = (float)obround->r,
.h = (float)obround->h
};
}
ARC_Obround ARC_FObround_CastToObround(ARC_FObround *obround){
return (ARC_Obround){
.x = (int32_t)obround->x,
.y = (int32_t)obround->y,
.r = (int32_t)obround->r,
.h = (int32_t)obround->h
};
}

View file

@ -3,6 +3,10 @@
void ARC_Vector2_Normalize(ARC_Vector2 *vector){
float length = sqrtf((vector->x * vector->x) + (vector->y * vector->y));
if(length == 0){
return;
}
vector->x /= length;
vector->y /= length;
}