12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
-
-
- #include <math.h>
-
- #ifndef _MATMATH_H
- #define _MATMATH_H
-
- #define HEL_PI M_PI
- #define HEL_2_PI (M_PI * 2.0)
- #define HEL_PI_OVER_4 M_PI_4
- #define HEL_PI_OVER_180 (M_PI / 180.0)
- #define HEL_180_OVER_PI (180.0 / M_PI)
-
- #define HEL_RAD_TO_DEG(x) ((x) * HEL_180_OVER_PI)
- #define HEL_DEG_TO_RAD(x) ((x) * HEL_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];
-
-
- int helIntersectionLineAndPolygon(vec3_t intersect, vec3_t p1, vec3_t p2, unsigned int vertexCount, vec3_t *polygon);
-
-
- vec_t helDistToSphereFromPlane3v(vec3_t center, vec_t radius, vec4_t plane);
-
-
- vec_t helDistToBboxFromPlane3v(vec3_t min, vec3_t max, vec4_t plane);
-
-
- vec_t helDist3v(vec3_t a, vec3_t b);
-
-
- void helMidpoint3v(vec3_t a, vec3_t b, vec3_t mid);
-
-
- vec_t helRandomNum(vec_t from, vec_t to);
-
- #endif
|