ARC_FObround added
This commit is contained in:
parent
c3361f640c
commit
5aede928d8
7 changed files with 62 additions and 0 deletions
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue