* If you intend to redistribute parts of the code without the LICENSE file
* replace this paragraph with the full contents of the LICENSE file.
*/
-static inline void cgm_wcons(cgm_vec4 *v, float x, float y, float z, float w)
+static CGM_INLINE void cgm_wcons(cgm_vec4 *v, float x, float y, float z, float w)
{
v->x = x;
v->y = y;
v->w = w;
}
-static inline void cgm_wadd(cgm_vec4 *a, const cgm_vec4 *b)
+static CGM_INLINE void cgm_wadd(cgm_vec4 *a, const cgm_vec4 *b)
{
a->x += b->x;
a->y += b->y;
a->w += b->w;
}
-static inline void cgm_wsub(cgm_vec4 *a, const cgm_vec4 *b)
+static CGM_INLINE void cgm_wsub(cgm_vec4 *a, const cgm_vec4 *b)
{
a->x -= b->x;
a->y -= b->y;
a->w -= b->w;
}
-static inline void cgm_wmul(cgm_vec4 *a, const cgm_vec4 *b)
+static CGM_INLINE void cgm_wmul(cgm_vec4 *a, const cgm_vec4 *b)
{
a->x *= b->x;
a->y *= b->y;
a->w *= b->w;
}
-static inline void cgm_wscale(cgm_vec4 *v, float s)
+static CGM_INLINE void cgm_wscale(cgm_vec4 *v, float s)
{
v->x *= s;
v->y *= s;
v->w *= s;
}
-static inline void cgm_wmul_m4v4(cgm_vec4 *v, const float *m)
+static CGM_INLINE void cgm_wmul_m4v4(cgm_vec4 *v, const float *m)
{
float x = v->x * m[0] + v->y * m[4] + v->z * m[8] + v->w * m[12];
float y = v->x * m[1] + v->y * m[5] + v->z * m[9] + v->w * m[13];
v->z = z;
}
-static inline void cgm_wmul_v4m4(cgm_vec4 *v, const float *m)
+static CGM_INLINE void cgm_wmul_v4m4(cgm_vec4 *v, const float *m)
{
float x = v->x * m[0] + v->y * m[1] + v->z * m[2] + v->w * m[3];
float y = v->x * m[4] + v->y * m[5] + v->z * m[6] + v->w * m[7];
v->z = z;
}
-static inline void cgm_wmul_m34v4(cgm_vec4 *v, const float *m)
+static CGM_INLINE void cgm_wmul_m34v4(cgm_vec4 *v, const float *m)
{
float x = v->x * m[0] + v->y * m[4] + v->z * m[8] + v->w * m[12];
float y = v->x * m[1] + v->y * m[5] + v->z * m[9] + v->w * m[13];
v->y = y;
}
-static inline void cgm_wmul_v4m43(cgm_vec4 *v, const float *m)
+static CGM_INLINE void cgm_wmul_v4m43(cgm_vec4 *v, const float *m)
{
float x = v->x * m[0] + v->y * m[1] + v->z * m[2] + v->w * m[3];
float y = v->x * m[4] + v->y * m[5] + v->z * m[6] + v->w * m[7];
v->y = y;
}
-static inline void cgm_wmul_m3v4(cgm_vec4 *v, const float *m)
+static CGM_INLINE void cgm_wmul_m3v4(cgm_vec4 *v, const float *m)
{
float x = v->x * m[0] + v->y * m[4] + v->z * m[8];
float y = v->x * m[1] + v->y * m[5] + v->z * m[9];
v->y = y;
}
-static inline void cgm_wmul_v4m3(cgm_vec4 *v, const float *m)
+static CGM_INLINE void cgm_wmul_v4m3(cgm_vec4 *v, const float *m)
{
float x = v->x * m[0] + v->y * m[1] + v->z * m[2];
float y = v->x * m[4] + v->y * m[5] + v->z * m[6];
v->y = y;
}
-static inline float cgm_wdot(const cgm_vec4 *a, const cgm_vec4 *b)
+static CGM_INLINE float cgm_wdot(const cgm_vec4 *a, const cgm_vec4 *b)
{
return a->x * b->x + a->y * b->y + a->z * b->z + a->w * b->w;
}
-static inline float cgm_wlength(const cgm_vec4 *v)
+static CGM_INLINE float cgm_wlength(const cgm_vec4 *v)
{
return sqrt(v->x * v->x + v->y * v->y + v->z * v->z + v->w * v->w);
}
-static inline float cgm_wlength_sq(const cgm_vec4 *v)
+static CGM_INLINE float cgm_wlength_sq(const cgm_vec4 *v)
{
return v->x * v->x + v->y * v->y + v->z * v->z + v->w * v->w;
}
-static inline float cgm_wdist(const cgm_vec4 *a, const cgm_vec4 *b)
+static CGM_INLINE float cgm_wdist(const cgm_vec4 *a, const cgm_vec4 *b)
{
float dx = a->x - b->x;
float dy = a->y - b->y;
return sqrt(dx * dx + dy * dy + dz * dz + dw * dw);
}
-static inline float cgm_wdist_sq(const cgm_vec4 *a, const cgm_vec4 *b)
+static CGM_INLINE float cgm_wdist_sq(const cgm_vec4 *a, const cgm_vec4 *b)
{
float dx = a->x - b->x;
float dy = a->y - b->y;
return dx * dx + dy * dy + dz * dz + dw * dw;
}
-static inline void cgm_wnormalize(cgm_vec4 *v)
+static CGM_INLINE void cgm_wnormalize(cgm_vec4 *v)
{
float len = cgm_wlength(v);
if(len != 0.0f) {
}
}
-static inline void cgm_wlerp(cgm_vec4 *res, const cgm_vec4 *a, const cgm_vec4 *b, float t)
+static CGM_INLINE void cgm_wlerp(cgm_vec4 *res, const cgm_vec4 *a, const cgm_vec4 *b, float t)
{
res->x = a->x + (b->x - a->x) * t;
res->y = a->y + (b->y - a->y) * t;