mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
public: rename rsqrt to Q_rsqrt due to weird collision with tgmath.h macro
It was reported on Discord with no additional information attached. But I guess it might be better to prefix our math- and crtlib functions in general.
This commit is contained in:
@@ -144,7 +144,7 @@ void RoundUpHullSize( vec3_t size )
|
|||||||
rsqrt
|
rsqrt
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
float rsqrt( float number )
|
float Q_rsqrt( float number )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ CONSTANTS AND HELPER MACROS
|
|||||||
#define VectorLerp( v1, lerp, v2, c ) ((c)[0] = (v1)[0] + (lerp) * ((v2)[0] - (v1)[0]), (c)[1] = (v1)[1] + (lerp) * ((v2)[1] - (v1)[1]), (c)[2] = (v1)[2] + (lerp) * ((v2)[2] - (v1)[2]))
|
#define VectorLerp( v1, lerp, v2, c ) ((c)[0] = (v1)[0] + (lerp) * ((v2)[0] - (v1)[0]), (c)[1] = (v1)[1] + (lerp) * ((v2)[1] - (v1)[1]), (c)[2] = (v1)[2] + (lerp) * ((v2)[2] - (v1)[2]))
|
||||||
#define VectorNormalize( v ) { float ilength = (float)sqrt(DotProduct(v, v));if (ilength) ilength = 1.0f / ilength;v[0] *= ilength;v[1] *= ilength;v[2] *= ilength; }
|
#define VectorNormalize( v ) { float ilength = (float)sqrt(DotProduct(v, v));if (ilength) ilength = 1.0f / ilength;v[0] *= ilength;v[1] *= ilength;v[2] *= ilength; }
|
||||||
#define VectorNormalize2( v, dest ) {float ilength = (float)sqrt(DotProduct(v,v));if (ilength) ilength = 1.0f / ilength;dest[0] = v[0] * ilength;dest[1] = v[1] * ilength;dest[2] = v[2] * ilength; }
|
#define VectorNormalize2( v, dest ) {float ilength = (float)sqrt(DotProduct(v,v));if (ilength) ilength = 1.0f / ilength;dest[0] = v[0] * ilength;dest[1] = v[1] * ilength;dest[2] = v[2] * ilength; }
|
||||||
#define VectorNormalizeFast( v ) {float ilength = (float)rsqrt(DotProduct(v,v)); v[0] *= ilength; v[1] *= ilength; v[2] *= ilength; }
|
#define VectorNormalizeFast( v ) {float ilength = (float)Q_rsqrt(DotProduct(v,v)); v[0] *= ilength; v[1] *= ilength; v[2] *= ilength; }
|
||||||
#define VectorNormalizeLength( v ) VectorNormalizeLength2((v), (v))
|
#define VectorNormalizeLength( v ) VectorNormalizeLength2((v), (v))
|
||||||
#define VectorNegate(x, y) ((y)[0] = -(x)[0], (y)[1] = -(x)[1], (y)[2] = -(x)[2])
|
#define VectorNegate(x, y) ((y)[0] = -(x)[0], (y)[1] = -(x)[1], (y)[2] = -(x)[2])
|
||||||
#define VectorM(scale1, b1, c) ((c)[0] = (scale1) * (b1)[0],(c)[1] = (scale1) * (b1)[1],(c)[2] = (scale1) * (b1)[2])
|
#define VectorM(scale1, b1, c) ((c)[0] = (scale1) * (b1)[0],(c)[1] = (scale1) * (b1)[1],(c)[2] = (scale1) * (b1)[2])
|
||||||
@@ -158,7 +158,7 @@ typedef struct mplane_s mplane_t;
|
|||||||
typedef struct mstudiobone_s mstudiobone_t;
|
typedef struct mstudiobone_s mstudiobone_t;
|
||||||
typedef struct mstudioanim_s mstudioanim_t;
|
typedef struct mstudioanim_s mstudioanim_t;
|
||||||
|
|
||||||
float rsqrt( float number );
|
float Q_rsqrt( float number );
|
||||||
uint16_t FloatToHalf( float v );
|
uint16_t FloatToHalf( float v );
|
||||||
float HalfToFloat( uint16_t h );
|
float HalfToFloat( uint16_t h );
|
||||||
void RoundUpHullSize( vec3_t size );
|
void RoundUpHullSize( vec3_t size );
|
||||||
|
|||||||
Reference in New Issue
Block a user