2022-11-11 01:15:54 -07:00
|
|
|
#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
|
|
|
|
|
|
2022-11-11 01:15:54 -07:00
|
|
|
typedef struct ARC_Point {
|
2023-01-30 23:22:34 -07:00
|
|
|
int32_t x;
|
|
|
|
|
int32_t y;
|
2022-11-11 01:15:54 -07:00
|
|
|
} ARC_Point;
|
|
|
|
|
|
|
|
|
|
typedef struct ARC_UPoint {
|
2023-01-30 23:22:34 -07:00
|
|
|
uint32_t x;
|
|
|
|
|
uint32_t y;
|
2022-11-11 01:15:54 -07:00
|
|
|
} ARC_UPoint;
|
|
|
|
|
|
2022-12-20 00:50:55 -07:00
|
|
|
typedef struct ARC_FPoint {
|
2023-01-30 23:22:34 -07:00
|
|
|
float x;
|
|
|
|
|
float y;
|
2022-12-20 00:50:55 -07:00
|
|
|
} ARC_FPoint;
|
|
|
|
|
|
2025-02-11 00:57:39 -07:00
|
|
|
typedef struct ARC_DPoint {
|
|
|
|
|
double x;
|
|
|
|
|
double y;
|
|
|
|
|
} ARC_DPoint;
|
|
|
|
|
|
2025-04-13 05:36:54 -06:00
|
|
|
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);
|
|
|
|
|
|
2025-04-13 05:36:54 -06:00
|
|
|
/**
|
|
|
|
|
* @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
|
|
|
|
|
|
2022-11-11 01:15:54 -07:00
|
|
|
#endif // ARC_MATH_POINT_H_
|