archeus/include/arc/math/point.h

56 lines
1,018 B
C
Raw Normal View History

#ifndef ARC_MATH_POINT_H_
#define ARC_MATH_POINT_H_
#include <stdint.h>
2023-01-30 23:22:34 -07:00
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ARC_Point {
2023-01-30 23:22:34 -07:00
int32_t x;
int32_t y;
} ARC_Point;
typedef struct ARC_UPoint {
2023-01-30 23:22:34 -07:00
uint32_t x;
uint32_t y;
} ARC_UPoint;
typedef struct ARC_FPoint {
2023-01-30 23:22:34 -07:00
float x;
float y;
} ARC_FPoint;
2025-02-11 00:57:39 -07:00
typedef struct ARC_DPoint {
double x;
double y;
} ARC_DPoint;
typedef struct ARC_Rect ARC_Rect;
typedef struct ARC_FRect ARC_FRect;
2023-09-14 01:34:08 -06:00
ARC_FPoint ARC_FPoint_Lerp(ARC_FPoint *start, ARC_FPoint *end, float t);
/**
* @brief centers point on given bounds
*
* @param point ARC_Point to be centered
* @param bounds ARC_Rect area to center point on
*/
void ARC_Point_CenterOn(ARC_Point *point, ARC_Rect bounds);
/**
* @brief centers fpoint on given bounds
*
* @param point ARC_FPoint to be centered
* @param bounds ARC_FRect area to center point on
*/
void ARC_FPoint_CenterOn(ARC_FPoint *point, ARC_FRect bounds);
2023-01-30 23:22:34 -07:00
#ifdef __cplusplus
}
#endif
#endif // ARC_MATH_POINT_H_