![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
Go to the source code of this file.
Functions | |
void | AnglesFromVectors (vec3_t angles, const vec3_t forward, const vec3_t up, qbool flippitch) |
LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors. | |
void | AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up) |
void | AngleVectorsDuke3DFLU (const vec3_t angles, vec3_t forward, vec3_t left, vec3_t up, double maxShearAngle) |
divVerent: improper matrix version of AngleVectors | |
void | AngleVectorsFLU (const vec3_t angles, vec3_t forward, vec3_t left, vec3_t up) |
LadyHavoc: proper matrix version of AngleVectors. | |
void | BoxFromPoints (vec3_t mins, vec3_t maxs, int numpoints, vec_t *point3f) |
int | BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs, const mplane_t *p) |
void | BoxPlaneCornerDistances (const vec3_t emins, const vec3_t emaxs, const mplane_t *p, vec_t *outneardist, vec_t *outfardist) |
void | BoxPlaneCornerDistances_Separate (const vec3_t emins, const vec3_t emaxs, const vec3_t normal, vec_t *outneardist, vec_t *outfardist) |
void | BoxPlaneCorners (const vec3_t emins, const vec3_t emaxs, const mplane_t *p, vec3_t outnear, vec3_t outfar) |
void | BoxPlaneCorners_Separate (const vec3_t emins, const vec3_t emaxs, const vec3_t normal, vec3_t outnear, vec3_t outfar) |
unsigned int | CeilPowerOf2 (unsigned int value) |
returns the smallest integer greater than or equal to "value", or 0 if "value" is too big | |
int | LoopingFrameNumberFromDouble (double t, int loopframes) |
int | Math_atov (const char *s, prvm_vec3_t out) |
float | Math_crandomf (randomseed_t *r) |
unsigned long long | Math_rand64 (randomseed_t *r) |
float | Math_randomf (randomseed_t *r) |
float | Math_randomrangef (randomseed_t *r, float minf, float maxf) |
int | Math_randomrangei (randomseed_t *r, int mini, int maxi) |
void | Math_RandomSeed_FromInts (randomseed_t *r, unsigned int s0, unsigned int s1, unsigned int s2, unsigned int s3) |
void | Math_RandomSeed_Reset (randomseed_t *r) |
static void | Math_RandomSeed_UnitTests (void) |
void | Mathlib_Init (void) |
void | Matrix4x4_Print (const matrix4x4_t *in) |
static void | mul128 (const unsigned int a[], const unsigned int b[], unsigned int dest[4]) |
void | PlaneClassify (mplane_t *p) |
void | R_ConcatRotations (const float in1[3 *3], const float in2[3 *3], float out[3 *3]) |
void | R_ConcatTransforms (const float in1[3 *4], const float in2[3 *4], float out[3 *4]) |
float | RadiusFromBounds (const vec3_t mins, const vec3_t maxs) |
float | RadiusFromBoundsAndOrigin (const vec3_t mins, const vec3_t maxs, const vec3_t origin) |
void | RotatePointAroundVector (vec3_t dst, const vec3_t dir, const vec3_t point, float degrees) |
static void | testmul128 (unsigned int a0, unsigned int a1, unsigned int a2, unsigned int a3, unsigned int b0, unsigned int b1, unsigned int b2, unsigned int b3, unsigned int x0, unsigned int x1, unsigned int x2, unsigned int x3) |
float | VectorNormalizeLength (vec3_t v) |
returns vector length | |
void | VectorVectors (const vec3_t forward, vec3_t right, vec3_t up) |
LadyHavoc: like AngleVectors, but taking a forward vector instead of angles, useful! | |
void | VectorVectorsDouble (const double *forward, double *right, double *up) |
Variables | |
float | ixtable [4096] |
float | m_bytenormals [NUMVERTEXNORMALS][3] |
static unsigned int | mul_Lecuyer [4] = { 0x12e15e35, 0xb500f16e, 0x2e714eb2, 0xb37916a5 } |
vec3_t | vec3_origin = {0,0,0} |
LadyHavoc: calculates pitch/yaw/roll angles from forward and up vectors.
Definition at line 650 of file mathlib.c.
References angles, AngleVectors(), Con_Printf(), cos(), DotProduct, forward, M_PI, PITCH, ROLL, sin(), sqrt(), up, VectorCopy, VectorDistance, VectorNormalize, VectorScale, and YAW.
Referenced by CL_NewParticlesFromEffectinfo(), CL_RotateMoves(), CL_UpdateNetworkEntity(), CL_VM_TransformView(), Matrix4x4_QuakeToDuke3D(), Mod_Decompile_SMD(), R_DecalSystem_SplatEntity(), and VM_vectoangles().
Definition at line 444 of file mathlib.c.
References angles, cos(), forward, M_PI, PITCH, right, ROLL, sin(), up, and YAW.
Referenced by AnglesFromVectors(), CL_ClientMovement_Physics_Swim(), CL_ClientMovement_Physics_Walk(), CL_NewParticlesFromEffectinfo(), CL_RotateMoves(), CL_UpdateEntityShading_GetDirectedFullbright(), CL_UpdateNetworkEntity(), Com_CalcRoll(), R_DecalSystem_SplatEntity(), SV_AirMove(), SV_Physics_Follow(), SV_WallFriction(), SV_WaterMove(), V_CalcRefdefUsing(), VM_CL_makevectors(), and VM_makevectors().
void AngleVectorsDuke3DFLU | ( | const vec3_t | angles, |
vec3_t | forward, | ||
vec3_t | left, | ||
vec3_t | up, | ||
double | maxShearAngle ) |
divVerent: improper matrix version of AngleVectors
Definition at line 552 of file mathlib.c.
References angles, cos(), f, fabs(), forward, M_PI, PITCH, ROLL, sin(), sqrt(), up, x, y, and YAW.
Referenced by Matrix4x4_QuakeToDuke3D().
LadyHavoc: proper matrix version of AngleVectors.
Definition at line 498 of file mathlib.c.
References angles, cos(), forward, M_PI, PITCH, ROLL, sin(), up, and YAW.
Referenced by SV_PushMove(), and VM_CL_RotateMoves().
Definition at line 877 of file mathlib.c.
References i, max, maxs, min, mins, and VectorCopy.
Referenced by Mod_BSP_FinalizePortals(), Mod_Q1BSP_LoadFaces(), and Mod_VBSP_LoadFaces().
Definition at line 331 of file mathlib.c.
References mplane_t::dist, mplane_t::normal, mplane_t::signbits, and mplane_t::type.
Referenced by Mod_BSP_BoxTouchingLeafPVS(), Mod_BSP_BoxTouchingPVS(), Mod_BSP_BoxTouchingVisibleLeafs(), Mod_BSP_FindBoxClusters(), and R_Q1BSP_RecursiveGetLightInfo_BSP().
void BoxPlaneCornerDistances | ( | const vec3_t | emins, |
const vec3_t | emaxs, | ||
const mplane_t * | p, | ||
vec_t * | outneardist, | ||
vec_t * | outfardist ) |
Definition at line 406 of file mathlib.c.
References mplane_t::dist, mplane_t::normal, mplane_t::signbits, and mplane_t::type.
void BoxPlaneCornerDistances_Separate | ( | const vec3_t | emins, |
const vec3_t | emaxs, | ||
const vec3_t | normal, | ||
vec_t * | outneardist, | ||
vec_t * | outfardist ) |
Definition at line 428 of file mathlib.c.
References normal.
void BoxPlaneCorners | ( | const vec3_t | emins, |
const vec3_t | emaxs, | ||
const mplane_t * | p, | ||
vec3_t | outnear, | ||
vec3_t | outfar ) |
Definition at line 367 of file mathlib.c.
References mplane_t::signbits, and mplane_t::type.
void BoxPlaneCorners_Separate | ( | const vec3_t | emins, |
const vec3_t | emaxs, | ||
const vec3_t | normal, | ||
vec3_t | outnear, | ||
vec3_t | outfar ) |
Definition at line 390 of file mathlib.c.
References normal.
returns the smallest integer greater than or equal to "value", or 0 if "value" is too big
Definition at line 292 of file mathlib.c.
References value.
Referenced by Font_LoadSize(), Mod_Q3BSP_LoadLightmaps(), and SndSys_Init().
Definition at line 891 of file mathlib.c.
References floor().
Referenced by R_GetCurrentTexture().
int Math_atov | ( | const char * | s, |
prvm_vec3_t | out ) |
Definition at line 856 of file mathlib.c.
References i, and VectorClear.
Referenced by R_Shadow_DrawModelShadowMaps(), R_Shadow_PrepareModelShadows(), and VM_stov().
float Math_crandomf | ( | randomseed_t * | r | ) |
Definition at line 1059 of file mathlib.c.
References Math_rand64(), n, and r.
unsigned long long Math_rand64 | ( | randomseed_t * | r | ) |
Definition at line 1042 of file mathlib.c.
References mul128(), mul_Lecuyer, and r.
Referenced by Math_crandomf(), Math_randomf(), and Math_randomrangei().
float Math_randomf | ( | randomseed_t * | r | ) |
Definition at line 1053 of file mathlib.c.
References Math_rand64(), n, and r.
Referenced by Math_randomrangef().
float Math_randomrangef | ( | randomseed_t * | r, |
float | minf, | ||
float | maxf ) |
int Math_randomrangei | ( | randomseed_t * | r, |
int | mini, | ||
int | maxi ) |
void Math_RandomSeed_Reset | ( | randomseed_t * | r | ) |
Definition at line 990 of file mathlib.c.
References testmul128().
Referenced by Mathlib_Init().
Definition at line 833 of file mathlib.c.
References a, ixtable, and Math_RandomSeed_UnitTests().
Referenced by Host_Init().
void Matrix4x4_Print | ( | const matrix4x4_t * | in | ) |
Definition at line 901 of file mathlib.c.
Referenced by Math_rand64(), and testmul128().
Definition at line 310 of file mathlib.c.
References mplane_t::normal, mplane_t::signbits, and mplane_t::type.
Referenced by Mod_BSP_FinalizePortals(), Mod_Q1BSP_LoadPlanes(), Mod_Q3BSP_LoadPlanes(), Mod_VBSP_LoadPlanes(), R_Shadow_ComputeShadowCasterCullingPlanes(), R_View_SetFrustum(), R_Water_AddWaterPlane(), and R_Water_ProcessPlanes().
Definition at line 781 of file mathlib.c.
Definition at line 800 of file mathlib.c.
Referenced by Mod_DARKPLACESMODEL_Load(), Mod_Skeletal_BuildTransforms(), and Mod_ZYMOTICMODEL_Load().
Definition at line 824 of file mathlib.c.
References max, maxs, mins, origin, sqrt(), VectorMultiply, and VectorSubtract.
Definition at line 258 of file mathlib.c.
References cos(), DEG2RAD, dir, sin(), VectorCopy, and VectorVectors().
|
static |
Definition at line 964 of file mathlib.c.
References a, b, Con_Printf(), mul128(), x1, x2, and x3.
Referenced by Math_RandomSeed_UnitTests().
returns vector length
Definition at line 763 of file mathlib.c.
References DotProduct, length, sqrt(), v, and VectorScale.
Referenced by CL_ClientMovement_Physics_CPM_PM_Aircontrol(), CL_ClientMovement_Physics_PM_AirAccelerate(), CL_ClientMovement_Physics_Swim(), CL_ClientMovement_Physics_Walk(), CL_ParticleEffect_Fallback(), CL_RelinkBeams(), DropPunchAngle(), Matrix4x4_QuakeToDuke3D(), R_Shadow_ComputeShadowCasterCullingPlanes(), SV_AirAccelerate(), and SV_AirMove().
LadyHavoc: like AngleVectors, but taking a forward vector instead of angles, useful!
Definition at line 199 of file mathlib.c.
References forward, right, up, VectorNormalize, and VectorSet.
Referenced by R_DrawParticle_TransparentCallback(), RotatePointAroundVector(), and VM_vectorvectors().
void VectorVectorsDouble | ( | const double * | forward, |
double * | right, | ||
double * | up ) |
float ixtable[4096] |
Definition at line 27 of file mathlib.c.
Referenced by Mathlib_Init(), Portal_CheckPolygon(), Portal_RecursiveFlow(), Portal_RecursiveFlowSearch(), and R_DrawPortals().
float m_bytenormals[NUMVERTEXNORMALS][3] |
Definition at line 31 of file mathlib.c.
Referenced by CL_EntityParticles(), and Mod_MDL_AnimateVertices().
|
static |
Definition at line 899 of file mathlib.c.
Referenced by Math_rand64().
vec3_t vec3_origin = {0,0,0} |
Definition at line 26 of file mathlib.c.
Referenced by CDAudio_Play_byName(), CL_LinkNetworkEntity(), CL_ParsePointParticles1(), CL_ParseTempEntity(), CL_ParseTrailParticles(), CL_SelectTraceLine(), CL_TraceBox(), CL_TraceLine(), CL_TracePoint(), CL_UpdateNetworkEntityTrail(), Collision_Cache_ClipLineToGenericEntitySurfaces(), Collision_ClipLineToGenericEntity(), dpvsimpledecode_open(), jam_open(), libavw_decodeframe(), PHYS_UnstickEntityReturnOffset(), R_DrawTextureSurfaceList_GL20(), R_Shadow_EditLights_Spawn_f(), R_Shadow_LoadLightsFile(), S_LocalSoundEx(), VM_CL_setmodel(), VM_CL_setmodelindex(), VM_CL_te_explosion(), VM_CL_te_explosionquad(), VM_CL_te_gunshot(), VM_CL_te_gunshotquad(), VM_CL_te_knightspike(), VM_CL_te_lavasplash(), VM_CL_te_plasmaburn(), VM_CL_te_smallflash(), VM_CL_te_spike(), VM_CL_te_spikequad(), VM_CL_te_superspike(), VM_CL_te_superspikequad(), VM_CL_te_tarexplosion(), VM_CL_te_teleport(), VM_CL_te_wizspike(), VM_SV_setmodel(), and VM_SV_setmodelindex().