123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
-
-
- #include <math.h>
-
- #ifndef _MATMATH_H
- #define _MATMATH_H
-
- #define HEL_PI ((float)M_PI)
- #define HEL_2_PI (HEL_PI * 2.0f)
- #define HEL_PI_OVER_4 (HEL_PI / 4.0f)
- #define HEL_PI_OVER_180 (HEL_PI / 180.0f)
- #define HEL_180_OVER_PI (180.0f / HEL_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];
-
-
- vec_t helIntersectionOfAbstractSpheres(vec3_t centerA, vec_t radiusA, vec3_t centerB, vec_t radiusB);
-
-
- int helIntersectionOfAbstractSphereAndLine(vec3_t center, vec_t radius, vec3_t posA, vec3_t posB, vec3_t intersectionA, vec3_t intersectionB);
-
-
- bool equalEpsilon(vec_t a, vec_t b);
-
-
- int helIntersectionLineAndPolygon(vec3_t intersect, vec3_t p1, vec3_t p2, 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
|