Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

//========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ============
9 years ago
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#pragma once
4 years ago
#if !defined(STUDIO_UTIL_H)
9 years ago
#define STUDIO_UTIL_H
4 years ago
#if !defined(M_PI)
9 years ago
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
#endif
4 years ago
#if !defined(M_PI_F)
#define M_PI_F (float)M_PI
#endif
4 years ago
#if !defined(PITCH)
9 years ago
// MOVEMENT INFO
// up / down
#define PITCH 0
// left / right
#define YAW 1
// fall over
#define ROLL 2
#endif
9 years ago
#define FDotProduct( a, b ) ( fabs( ( a[0] ) * ( b[0] ) ) + fabs( ( a[1] ) * ( b[1] ) ) + fabs( ( a[2] ) * ( b[2] ) ) )
9 years ago
9 years ago
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] );
9 years ago
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 );
9 years ago
#endif // STUDIO_UTIL_H