|
|
@ -173,6 +173,12 @@ static inline float UintAsFloat( uint32_t u ) |
|
|
|
return bits.fl; |
|
|
|
return bits.fl; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline void SinCos( float radians, float *sine, float *cosine ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
*sine = sin(radians); |
|
|
|
|
|
|
|
*cosine = cos(radians); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float rsqrt( float number ); |
|
|
|
float rsqrt( float number ); |
|
|
|
float anglemod( float a ); |
|
|
|
float anglemod( float a ); |
|
|
|
word FloatToHalf( float v ); |
|
|
|
word FloatToHalf( float v ); |
|
|
@ -181,7 +187,6 @@ void RoundUpHullSize( vec3_t size ); |
|
|
|
int SignbitsForPlane( const vec3_t normal ); |
|
|
|
int SignbitsForPlane( const vec3_t normal ); |
|
|
|
int PlaneTypeForNormal( const vec3_t normal ); |
|
|
|
int PlaneTypeForNormal( const vec3_t normal ); |
|
|
|
int NearestPOW( int value, qboolean roundDown ); |
|
|
|
int NearestPOW( int value, qboolean roundDown ); |
|
|
|
void SinCos( float radians, float *sine, float *cosine ); |
|
|
|
|
|
|
|
float VectorNormalizeLength2( const vec3_t v, vec3_t out ); |
|
|
|
float VectorNormalizeLength2( const vec3_t v, vec3_t out ); |
|
|
|
qboolean VectorCompareEpsilon( const vec3_t vec1, const vec3_t vec2, vec_t epsilon ); |
|
|
|
qboolean VectorCompareEpsilon( const vec3_t vec1, const vec3_t vec2, vec_t epsilon ); |
|
|
|
void VectorVectors( const vec3_t forward, vec3_t right, vec3_t up ); |
|
|
|
void VectorVectors( const vec3_t forward, vec3_t right, vec3_t up ); |
|
|
@ -208,6 +213,20 @@ void QuaternionSlerp( const vec4_t p, const vec4_t q, float t, vec4_t qt ); |
|
|
|
#define Matrix3x4_LoadIdentity( mat ) Matrix3x4_Copy( mat, m_matrix3x4_identity ) |
|
|
|
#define Matrix3x4_LoadIdentity( mat ) Matrix3x4_Copy( mat, m_matrix3x4_identity ) |
|
|
|
#define Matrix3x4_Copy( out, in ) memcpy( out, in, sizeof( matrix3x4 )) |
|
|
|
#define Matrix3x4_Copy( out, in ) memcpy( out, in, sizeof( matrix3x4 )) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline void Matrix3x4_SetOrigin( matrix3x4 out, float x, float y, float z ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
out[0][3] = x; |
|
|
|
|
|
|
|
out[1][3] = y; |
|
|
|
|
|
|
|
out[2][3] = z; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline void Matrix3x4_OriginFromMatrix( const matrix3x4 in, float *out ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
out[0] = in[0][3]; |
|
|
|
|
|
|
|
out[1] = in[1][3]; |
|
|
|
|
|
|
|
out[2] = in[2][3]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Matrix3x4_VectorTransform( const matrix3x4 in, const float v[3], float out[3] ); |
|
|
|
void Matrix3x4_VectorTransform( const matrix3x4 in, const float v[3], float out[3] ); |
|
|
|
void Matrix3x4_VectorITransform( const matrix3x4 in, const float v[3], float out[3] ); |
|
|
|
void Matrix3x4_VectorITransform( const matrix3x4 in, const float v[3], float out[3] ); |
|
|
|
void Matrix3x4_VectorRotate( const matrix3x4 in, const float v[3], float out[3] ); |
|
|
|
void Matrix3x4_VectorRotate( const matrix3x4 in, const float v[3], float out[3] ); |
|
|
@ -216,8 +235,6 @@ void Matrix3x4_ConcatTransforms( matrix3x4 out, const matrix3x4 in1, const matri |
|
|
|
void Matrix3x4_FromOriginQuat( matrix3x4 out, const vec4_t quaternion, const vec3_t origin ); |
|
|
|
void Matrix3x4_FromOriginQuat( matrix3x4 out, const vec4_t quaternion, const vec3_t origin ); |
|
|
|
void Matrix3x4_CreateFromEntity( matrix3x4 out, const vec3_t angles, const vec3_t origin, float scale ); |
|
|
|
void Matrix3x4_CreateFromEntity( matrix3x4 out, const vec3_t angles, const vec3_t origin, float scale ); |
|
|
|
void Matrix3x4_TransformAABB( const matrix3x4 world, const vec3_t mins, const vec3_t maxs, vec3_t absmin, vec3_t absmax ); |
|
|
|
void Matrix3x4_TransformAABB( const matrix3x4 world, const vec3_t mins, const vec3_t maxs, vec3_t absmin, vec3_t absmax ); |
|
|
|
void Matrix3x4_SetOrigin( matrix3x4 out, float x, float y, float z ); |
|
|
|
|
|
|
|
void Matrix3x4_OriginFromMatrix( const matrix3x4 in, float *out ); |
|
|
|
|
|
|
|
void Matrix3x4_AnglesFromMatrix( const matrix3x4 in, vec3_t out ); |
|
|
|
void Matrix3x4_AnglesFromMatrix( const matrix3x4 in, vec3_t out ); |
|
|
|
|
|
|
|
|
|
|
|
#define Matrix4x4_LoadIdentity( mat ) Matrix4x4_Copy( mat, m_matrix4x4_identity ) |
|
|
|
#define Matrix4x4_LoadIdentity( mat ) Matrix4x4_Copy( mat, m_matrix4x4_identity ) |
|
|
|