2018-01-19 18:00:32 +01:00
|
|
|
//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============
|
2016-06-04 15:24:23 +02:00
|
|
|
//
|
|
|
|
// Purpose:
|
|
|
|
//
|
|
|
|
// $NoKeywords: $
|
|
|
|
//=============================================================================
|
2017-12-10 21:40:41 +01:00
|
|
|
#pragma once
|
2021-06-20 00:53:07 +02:00
|
|
|
#if !defined(STUDIO_UTIL_H)
|
2016-06-04 15:24:23 +02:00
|
|
|
#define STUDIO_UTIL_H
|
|
|
|
|
2021-06-20 00:53:07 +02:00
|
|
|
#if !defined(M_PI)
|
2016-06-04 15:24:23 +02:00
|
|
|
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
|
|
|
#endif
|
|
|
|
|
2021-06-20 00:53:07 +02:00
|
|
|
#if !defined(M_PI_F)
|
2019-10-13 13:49:25 +02:00
|
|
|
#define M_PI_F (float)M_PI
|
|
|
|
#endif
|
|
|
|
|
2021-06-20 00:53:07 +02:00
|
|
|
#if !defined(PITCH)
|
2016-06-04 15:24:23 +02:00
|
|
|
// MOVEMENT INFO
|
|
|
|
// up / down
|
|
|
|
#define PITCH 0
|
|
|
|
// left / right
|
|
|
|
#define YAW 1
|
|
|
|
// fall over
|
|
|
|
#define ROLL 2
|
|
|
|
#endif
|
|
|
|
|
2016-07-03 15:39:55 +02:00
|
|
|
#define FDotProduct( a, b ) ( fabs( ( a[0] ) * ( b[0] ) ) + fabs( ( a[1] ) * ( b[1] ) ) + fabs( ( a[2] ) * ( b[2] ) ) )
|
2016-06-04 15:24:23 +02:00
|
|
|
|
2016-07-03 15:39:55 +02:00
|
|
|
void AngleMatrix( const float *angles, float (*matrix)[4] );
|
|
|
|
int VectorCompare( const float *v1, const float *v2 );
|
|
|
|
void CrossProduct( const float *v1, const float *v2, float *cross );
|
|
|
|
void VectorTransform( const float *in1, float in2[3][4], float *out );
|
|
|
|
void ConcatTransforms( float in1[3][4], float in2[3][4], float out[3][4] );
|
2016-06-04 15:24:23 +02:00
|
|
|
void MatrixCopy( float in[3][4], float out[3][4] );
|
|
|
|
void QuaternionMatrix( vec4_t quaternion, float (*matrix)[4] );
|
|
|
|
void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt );
|
|
|
|
void AngleQuaternion( float *angles, vec4_t quaternion );
|
2016-07-03 15:39:55 +02:00
|
|
|
#endif // STUDIO_UTIL_H
|