#include <math.h>
Include dependency graph for MATHLIB.H:

Go to the source code of this file.
Defines | |
| #define | DEG2RAD(a) ( ( (a) * Q_PI ) / 180.0f ) |
| #define | DotProduct(x, y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) |
| #define | EQUAL_EPSILON 0.001 |
| #define | Q_PI 3.14159265358979323846 |
| #define | RAD2DEG(a) ( ( (a) * 180.0f ) / Q_PI ) |
| #define | SIDE_BACK 1 |
| #define | SIDE_CROSS -2 |
| #define | SIDE_FRONT 0 |
| #define | SIDE_ON 2 |
| #define | VectorAdd(a, b, c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];} |
| #define | VectorClear(x) {x[0] = x[1] = x[2] = 0;} |
| #define | VectorCopy(a, b) {b[0]=a[0];b[1]=a[1];b[2]=a[2];} |
| #define | VectorSet(v, a, b, c) {v[0]=a;v[1]=b;v[2]=c;} |
| #define | VectorSubtract(a, b, c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];} |
| #define | ZERO_EPSILON 1.0E-6 |
Typedefs | |
| typedef vec_t | vec3_t [3] |
| typedef vec_t | vec5_t [5] |
| typedef float | vec_t |
Functions | |
| vec_t | _DotProduct (vec3_t v1, vec3_t v2) |
| void | _Vector53Copy (vec5_t in, vec3_t out) |
| void | _Vector5Add (vec5_t va, vec5_t vb, vec5_t out) |
| void | _Vector5Scale (vec5_t v, vec_t scale, vec5_t out) |
| void | _VectorAdd (vec3_t va, vec3_t vb, vec3_t out) |
| void | _VectorCopy (vec3_t in, vec3_t out) |
| void | _VectorSubtract (vec3_t va, vec3_t vb, vec3_t out) |
| void | AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs) |
| void | AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up) |
| void | ClearBounds (vec3_t mins, vec3_t maxs) |
| void | CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross) |
| vec_t | Q_rint (vec_t in) |
| qboolean | VectorCompare (vec3_t v1, vec3_t v2) |
| void | VectorInverse (vec3_t v) |
| float | VectorLength (vec3_t v) |
| void | VectorMA (vec3_t va, float scale, vec3_t vb, vec3_t vc) |
| vec_t | VectorNormalize (vec3_t v) |
| void | VectorPolar (vec3_t v, float radius, float theta, float phi) |
| void | VectorScale (vec3_t v, vec_t scale, vec3_t out) |
| void | VectorSnap (vec3_t v) |
| void | VectorToAngles (vec3_t vec, vec3_t angles) |
Variables | |
| vec3_t | vec3_origin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 81 of file MATHLIB.H. Referenced by TexMatToFakeTexCoords(). |
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
Definition at line 170 of file l_math.c. Referenced by CapSpecial().
|
|
||||||||||||
|
Definition at line 203 of file MATHLIB.CPP. References in. Referenced by Patch_FromTriangle().
|
|
||||||||||||||||
|
Definition at line 185 of file MATHLIB.CPP. References va(). Referenced by Patch_FromTriangle(). 00186 {
00187 out[0] = va[0]+vb[0];
00188 out[1] = va[1]+vb[1];
00189 out[2] = va[2]+vb[2];
00190 out[3] = va[3]+vb[3];
00191 out[4] = va[4]+vb[4];
00192 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 194 of file MATHLIB.CPP. References v. Referenced by Patch_FromTriangle(). 00195 {
00196 out[0] = v[0] * scale;
00197 out[1] = v[1] * scale;
00198 out[2] = v[2] * scale;
00199 out[3] = v[3] * scale;
00200 out[4] = v[4] * scale;
00201 }
|
|
||||||||||||||||
|
Definition at line 182 of file l_math.c. References va().
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 189 of file l_math.c. References in. Referenced by CXYWnd::AddPointPoint().
|
|
||||||||||||||||
|
Definition at line 175 of file l_math.c. References va().
|
Here is the call graph for this function:

|
||||||||||||||||
|
||||||||||||||||||||
|
Definition at line 29 of file l_math.c. References cos(), cp, M_PI, right, sin(), and up. Referenced by AAS_Reachability_Teleport(), AAS_SetMovedir(), AAS_WeaponJumpZVelocity(), AnglesToAxis(), BotAIBlocked(), BotCheckAttack(), BotExportTest(), BotGetLongTermGoal(), BotInputToUserCommand(), BotRandomMove(), BotSetMovedir(), CG_AddParticles(), CG_AddParticleToScene(), CG_CalcMuzzlePoint(), CG_DamageFeedback(), CG_GrappleTrail(), CG_LightningBolt(), CG_OffsetFirstPersonView(), CG_OffsetThirdPersonView(), CG_ParticleBloodCloud(), CG_ParticleDust(), CheckGauntletAttack(), CM_TransformedPointContents(), CreateRotationMatrix(), Drop_Item(), FacingVectors(), FireWeapon(), G_CreateRotationMatrix(), G_SetMovedir(), G_TryPushingProxMine(), Pickup_Powerup(), PmoveSingle(), PodiumPlacementThink(), SpawnModelOnVictoryPad(), SpawnPodium(), SV_GameSystemCalls(), TeleportPlayer(), UI_MovedirAdjustment(), and ValidBloodPool(). 00030 {
00031 float angle;
00032 static float sr, sp, sy, cr, cp, cy;
00033 // static to help MS compiler fp bugs
00034
00035 angle = angles[YAW] * (M_PI*2 / 360);
00036 sy = sin(angle);
00037 cy = cos(angle);
00038 angle = angles[PITCH] * (M_PI*2 / 360);
00039 sp = sin(angle);
00040 cp = cos(angle);
00041 angle = angles[ROLL] * (M_PI*2 / 360);
00042 sr = sin(angle);
00043 cr = cos(angle);
00044
00045 if (forward)
00046 {
00047 forward[0] = cp*cy;
00048 forward[1] = cp*sy;
00049 forward[2] = -sp;
00050 }
00051 if (right)
00052 {
00053 right[0] = (-1*sr*sp*cy+-1*cr*-sy);
00054 right[1] = (-1*sr*sp*sy+-1*cr*cy);
00055 right[2] = -1*sr*cp;
00056 }
00057 if (up)
00058 {
00059 up[0] = (cr*sp*cy+-sr*-sy);
00060 up[1] = (cr*sp*sy+-sr*cy);
00061 up[2] = cr*cp;
00062 }
00063 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 270 of file l_math.c. Referenced by AAS_FixMapBrush(), AAS_MakeBrushWindings(), AAS_StoreArea(), AllocateLightmapForSurface(), AllocTree(), BeginModel(), BoundBrush(), CalcNodeBounds(), CalcTerrainSize(), CEpairsWrapper::CalculateRotatedBounds(), CM_GeneratePatchCollide(), Face_FitTexture(), FogDrawSurfs(), HL_LoadMapFromBSP(), InitSurfacesForTesting(), LoadMapFile(), MakeBrushWindings(), ParseTriSurf(), PatchMapDrawSurfs(), Q1_LoadMapFromBSP(), Q2_LoadMapFile(), Q2_LoadMapFromBSP(), Q3_LoadMapFromBSP(), R_AddWorldSurfaces(), R_CreateSurfaceGridMesh(), R_MarkFragments(), Sin_LoadMapFromBSP(), SubdivideDrawSurf(), TH_CreateTriangle(), Tree_Alloc(), VL_InitSurfacesForTesting(), VL_LightmapMatrixFromPoints(), VS_InitSurfacesForTesting(), and VS_LightmapMatrixFromPoints(). 00271 {
00272 mins[0] = mins[1] = mins[2] = 99999;
00273 maxs[0] = maxs[1] = maxs[2] = -99999;
00274 }
|
|
||||||||||||||||
|
|
Definition at line 151 of file l_math.c. References floor(), g_PrefsDlg, in, CPrefsDlg::m_bNoClamp, and vec_t. Referenced by AAS_GetVertex(), Brush_CreatePyramid(), GetVertexnum(), SnapPlane(), TH_FindVertex(), TH_SnapPlane(), WriteFloat(), and WriteFloat2(). 00152 {
00153 return floor(in + 0.5);
00154 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 140 of file l_math.c. References fabs(), i, qboolean, v1, and v2. Referenced by AAS_SetMovedir(), AAS_UpdateEntity(), AddPatchMovePoint(), AddPoint(), AINode_Seek_ActivateEntity(), BotGetActivateGoal(), BotSetMovedir(), Brush_SideSelect(), CG_PredictPlayerState(), Face_MakePlane(), FloodEntities(), G_SetMovedir(), InitTrigger(), Patch_CapCurrent(), Patch_DragScale(), PointValueInMoveList(), and Terrain_DragScale(). 00141 {
00142 int i;
00143
00144 for (i=0 ; i<3 ; i++)
00145 if (fabs(v1[i]-v2[i]) > EQUAL_EPSILON)
00146 return false;
00147
00148 return true;
00149 }
|
Here is the call graph for this function:

|
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Definition at line 63 of file MATHLIB.CPP. References va(). 00064 {
00065 vc[0] = va[0] + scale*vb[0];
00066 vc[1] = va[1] + scale*vb[1];
00067 vc[2] = va[2] + scale*vb[2];
00068 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Definition at line 169 of file MATHLIB.CPP. References cos(), sin(), and v. Referenced by Brush_MakeSidedSphere(). 00170 {
00171 v[0]=float(radius * cos(theta) * cos(phi));
00172 v[1]=float(radius * sin(theta) * cos(phi));
00173 v[2]=float(radius * sin(phi));
00174 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 128 of file MATHLIB.CPP. References v. 00129 {
00130 out[0] = v[0] * scale;
00131 out[1] = v[1] * scale;
00132 out[2] = v[2] * scale;
00133 }
|
|
|
Definition at line 176 of file MATHLIB.CPP. Referenced by Eclass_hasModel().
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 275 of file MATHLIB.CPP. References atan2(), and sqrt(). 00276 {
00277 float forward;
00278 float yaw, pitch;
00279
00280 if ( ( vec[ 0 ] == 0 ) && ( vec[ 1 ] == 0 ) )
00281 {
00282 yaw = 0;
00283 if ( vec[ 2 ] > 0 )
00284 {
00285 pitch = 90;
00286 }
00287 else
00288 {
00289 pitch = 270;
00290 }
00291 }
00292 else
00293 {
00294 yaw = atan2( vec[ 1 ], vec[ 0 ] ) * 180 / M_PI;
00295 if ( yaw < 0 )
00296 {
00297 yaw += 360;
00298 }
00299
00300 forward = ( float )sqrt( vec[ 0 ] * vec[ 0 ] + vec[ 1 ] * vec[ 1 ] );
00301 pitch = atan2( vec[ 2 ], forward ) * 180 / M_PI;
00302 if ( pitch < 0 )
00303 {
00304 pitch += 360;
00305 }
00306 }
00307
00308 angles[ 0 ] = pitch;
00309 angles[ 1 ] = yaw;
00310 angles[ 2 ] = 0;
00311 }
|
Here is the call graph for this function:

|
|
|
1.3.9.1