1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
-
-
- #include <math.h>
-
- #ifndef _MATH_MATH_H
- #define _MATH_MATH_H
-
- #ifndef M_PI
- #define M_PI 3.14159265358979323846
- #endif
-
- #define OR_PI ((float)M_PI)
- #define OR_2_PI (OR_PI * 2.0f)
- #define OR_PI_OVER_4 (OR_PI / 4.0f)
- #define OR_PI_OVER_180 (OR_PI / 180.0f)
- #define OR_180_OVER_PI (180.0f / OR_PI)
-
- #define OR_RAD_TO_DEG(x) ((x) * OR_180_OVER_PI)
- #define OR_DEG_TO_RAD(x) ((x) * OR_PI_OVER_180)
-
- typedef float vec_t;
- typedef float vec2_t[2];
- typedef float vec3_t[3];
- typedef float vec4_t[4];
- typedef vec_t matrix_t[16];
-
-
- bool equalEpsilon(vec_t a, vec_t b);
-
-
- int intersectionLinePolygon(vec3_t intersect, vec3_t p1, vec3_t p2, vec3_t *polygon);
-
-
- vec_t distance(const vec3_t a, const vec3_t b);
-
-
- void midpoint(const vec3_t a, const vec3_t b, vec3_t mid);
-
-
- vec_t randomNum(vec_t from, vec_t to);
-
- #endif
|