82cvar_t cl_viewmodel_scale = {
CF_CLIENT,
"cl_viewmodel_scale",
"1",
"changes size of gun model, lower values prevent poking into walls but cause strange artifacts on lighting and especially r_stereo/vid_stereobuffer options where the size of the gun becomes visible"};
123cvar_t v_centermove = {
CF_CLIENT,
"v_centermove",
"0.15",
"how long before the view begins to center itself (if freelook/+mlook/+jlook/+klook are off)"};
128cvar_t cl_smoothviewheight = {
CF_CLIENT |
CF_ARCHIVE,
"cl_smoothviewheight",
"0",
"time of the averaging to the viewheight value so that it creates a smooth transition. higher values = longer transition, 0 for instant transition."};
143cvar_t v_yshearing = {
CF_CLIENT,
"v_yshearing",
"0",
"be all out of gum (set this to the maximum angle to allow Y shearing for - try values like 75)"};
278 count = blood*0.5 + armor*0.5;
370 Con_Printf(
"usage:\nbf, or bf R G B [A [alphafade]]\n");
394static vec3_t eyeboxmins = {-16, -16, -24};
395static vec3_t eyeboxmaxs = { 16, 16, 32};
400 frac =
bound(0, frac, 1);
401 return (*store = *store * (1 - frac) +
value * frac);
514 float vieworg[3], viewangles[3], smoothtime;
515 float gunorg[3], gunangles[3];
517 static float viewheightavg;
572 viewheightavg = viewheightavg * (1 - viewheight) + clstatsviewheight * viewheight;
573 vieworg[2] += viewheightavg;
578 vec_t camback, camup, dist, campitch,
forward[3], chase_dest[3];
591 viewangles[
PITCH] = 0;
594 chase_dest[0] = vieworg[0] -
forward[0] * camback +
up[0] * camup;
595 chase_dest[1] = vieworg[1] -
forward[1] * camback +
up[1] * camup;
596 chase_dest[2] = vieworg[2] -
forward[2] * camback +
up[2] * camup;
598 trace =
CL_TraceLine(vieworg, chase_dest,
MOVE_NOMONSTERS,
NULL,
SUPERCONTENTS_SOLID |
SUPERCONTENTS_SKY, 0,
MATERIALFLAGMASK_TRANSLUCENT,
collision_extendmovelength.
value,
true,
false,
NULL,
false,
true);
606 chase_dest[0] = vieworg[0] -
forward[0] * camback +
up[0] * camup +
offset[0];
607 chase_dest[1] = vieworg[1] -
forward[1] * camback +
up[1] * camup +
offset[1];
608 chase_dest[2] = vieworg[2] -
forward[2] * camback +
up[2] * camup +
offset[2];
609 trace =
CL_TraceLine(vieworg, chase_dest,
MOVE_NOMONSTERS,
NULL,
SUPERCONTENTS_SOLID |
SUPERCONTENTS_SKY, 0,
MATERIALFLAGMASK_TRANSLUCENT,
collision_extendmovelength.
value,
true,
false,
NULL,
false,
true);
610 if (bestvieworg[2] > trace.
endpos[2])
611 bestvieworg[2] = trace.
endpos[2];
616 viewangles[
PITCH] = campitch;
623 viewangles[
PITCH] = 90;
630 chase_dest[0] = vieworg[0] +
forward[0] * dist;
631 chase_dest[1] = vieworg[1] +
forward[1] * dist;
632 chase_dest[2] = vieworg[2] +
forward[2] * dist + camup;
633 trace =
CL_TraceLine(vieworg, chase_dest,
MOVE_NOMONSTERS,
NULL,
SUPERCONTENTS_SOLID |
SUPERCONTENTS_SKY, 0,
MATERIALFLAGMASK_TRANSLUCENT,
collision_extendmovelength.
value,
true,
false,
NULL,
false,
true);
648 double xyspeed = 0, bob = 0, bobfall = 0;
699 VectorAdd(viewangles, gunangles, gunangles);
719 float trace1fraction;
720 float trace2fraction;
721 vec3_t bob_height_check_dest;
724 bob_height_check_dest[0] = vieworg[0];
725 bob_height_check_dest[1] = vieworg[1];
727 trace =
CL_TraceLine(vieworg, bob_height_check_dest,
MOVE_NOMONSTERS,
NULL,
SUPERCONTENTS_SOLID |
SUPERCONTENTS_SKY | (
cl_bob_limit_heightcheck_dontcrosswatersurface.
integer ?
SUPERCONTENTS_LIQUIDSMASK : 0), 0,
MATERIALFLAGMASK_TRANSLUCENT,
collision_extendmovelength.
value,
true,
false,
NULL,
false,
true);
730 bob_height_check_dest[0] = vieworg[0];
731 bob_height_check_dest[1] = vieworg[1];
733 trace =
CL_TraceLine(vieworg, bob_height_check_dest,
MOVE_NOMONSTERS,
NULL,
SUPERCONTENTS_SOLID |
SUPERCONTENTS_SKY | (
cl_bob_limit_heightcheck_dontcrosswatersurface.
integer ?
SUPERCONTENTS_LIQUIDSMASK : 0), 0,
MATERIALFLAGMASK_TRANSLUCENT,
collision_extendmovelength.
value,
true,
false,
NULL,
false,
true);
736 bob_limit *=
min(trace1fraction, trace2fraction);
744 cycle -= (
int) cycle;
752 bob = bob*0.3 + bob*0.7*
sin(cycle);
753 bob =
bound(-7, bob, bob_limit);
773 cycle -= (
int) cycle;
775 cycle =
cos(
M_PI * cycle / 0.5);
782 if (clonground && !clcmdjump)
802 vieworg[0] += bob2vel[0];
803 vieworg[1] += bob2vel[1];
808 gunorg[0] += bob2vel[0];
809 gunorg[1] += bob2vel[1];
829 vieworg[2] += bobfall;
830 gunorg[2] += bobfall;
873 t =
bound(0, t, 0.2);
883 t = 0.2 -
bound(0, t, 0.2);
887 bspeed = xyspeed * 0.01f;
896 for (
int i = 0;
i < 3;
i++)
1180 float deathfadevec[3] = {0.3f, 0.0f, 0.0f};
#define SUPERCONTENTS_SKY
#define SUPERCONTENTS_LAVA
#define SUPERCONTENTS_SLIME
#define SUPERCONTENTS_SOLID
#define SUPERCONTENTS_LIQUIDSMASK
trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities, qbool hitsurfaces)
#define CL_PointSuperContents(point)
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
static int Cmd_Argc(cmd_state_t *cmd)
static const char * Cmd_Argv(cmd_state_t *cmd, int arg)
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are alwa...
#define CF_CLIENT
cvar/command that only the client can change/execute
#define CF_CLIENT_FROM_SERVER
command that the server is allowed to execute on the client
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
cvar_t collision_extendmovelength
void MSG_ReadVector(sizebuf_t *sb, vec3_t v, protocolversion_t protocol)
float Com_CalcRoll(const vec3_t angles, const vec3_t velocity, const vec_t angleval, const vec_t velocityval)
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
void CL_VM_UpdateDmgGlobals(int dmg_take, int dmg_save, vec3_t dmg_origin)
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
static int(ZEXPORT *qz_inflate)(z_stream *strm
GLsizei const GLfloat * value
GLenum GLenum GLsizei count
GLuint GLuint GLintptr offset
#define Image_LinearFloatFromsRGB(c)
void AngleVectors(const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
#define VectorLerp(v1, lerp, v2, out)
#define VectorNormalize(v)
#define bound(min, num, max)
#define VectorMAMAM(scale1, b1, scale2, b2, scale3, b3, out)
#define VectorSet(vec, x, y, z)
#define VectorSubtract(a, b, out)
#define VectorCopy(in, out)
#define VectorScale(in, scale, out)
#define VectorMAM(scale1, b1, scale2, b2, out)
#define VectorAdd(a, b, out)
#define VectorMA(a, scale, b, out)
#define VectorMAMAMAM(scale1, b1, scale2, b2, scale3, b3, scale4, b4, out)
void Matrix4x4_AdjustOrigin(matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_Concat(matrix4x4_t *out, const matrix4x4_t *in1, const matrix4x4_t *in2)
void Matrix4x4_Transform(const matrix4x4_t *in, const float v[3], float out[3])
void Matrix4x4_QuakeToDuke3D(const matrix4x4_t *in, matrix4x4_t *out, double maxShearAngle)
void Matrix4x4_CreateTranslate(matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_FromArrayFloatGL(matrix4x4_t *out, const float in[16])
void Matrix4x4_CreateFromQuakeEntity(matrix4x4_t *out, double x, double y, double z, double pitch, double yaw, double roll, double scale)
void Matrix4x4_ConcatScale(matrix4x4_t *out, double x)
void Matrix4x4_CreateScale(matrix4x4_t *out, double x)
void Matrix4x4_Invert_Simple(matrix4x4_t *out, const matrix4x4_t *in1)
void Matrix4x4_FromVectors(matrix4x4_t *out, const float vx[3], const float vy[3], const float vz[3], const float t[3])
void Matrix4x4_ToVectors(const matrix4x4_t *in, float vx[3], float vy[3], float vz[3], float t[3])
const matrix4x4_t identitymatrix
void Matrix4x4_Copy(matrix4x4_t *out, const matrix4x4_t *in)
void Matrix4x4_OriginFromMatrix(const matrix4x4_t *in, float *out)
#define MATERIALFLAGMASK_TRANSLUCENT
#define STAT_ITEMS
FTE, DP.
#define STAT_VIEWHEIGHT
FTE, DP.
#define IT_INVULNERABILITY
vec3_t csqc_viewanglesfromengine
vec3_t qw_intermission_origin
unsigned short csqc_server2csqcentitynumber[MAX_EDICTS]
vec3_t csqc_vieworiginfromengine
double calcrefdef_prevtime
cshift_t cshifts[NUM_CSHIFTS]
matrix4x4_t csqc_viewmodelmatrixfromengine
vec3_t gunangles_highpass
usercmd_t movecmd[CL_MAX_USERCMDS]
vec3_t gunangles_adjustment_lowpass
float movevars_stepheight
vec3_t qw_intermission_angles
vec3_t gunorg_adjustment_lowpass
vec3_t gunangles_adjustment_highpass
vec3_t gunorg_adjustment_highpass
protocolversion_t protocol
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cv...
matrix4x4_t inversematrix
entity_persistent_t persistent
entity_state_t state_current
int useperspective
if turned off it renders an ortho view
int usevieworiginculling
allows visibility culling based on the view origin (e.g.
qbool sRGB3D
whether 3D rendering is sRGB corrected (based on sRGBcapable3D)
viddef_t vid
global video state
void V_StartPitchDrift_f(cmd_state_t *cmd)
cvar_t cl_bob_velocity_limit
cvar_t cl_followmodel_up_speed
cvar_t cl_leanmodel_up_highpass
cvar_t cl_leanmodel_up_speed
cvar_t cl_bob_limit_heightcheck_dontcrosswatersurface
static vec_t lowpass_limited(vec_t value, vec_t frac, vec_t limit, vec_t *store)
static void highpass3_limited(vec3_t value, vec_t fracx, vec_t limitx, vec_t fracy, vec_t limity, vec_t fracz, vec_t limitz, vec3_t store, vec3_t out)
cvar_t cl_bobmodel_forward
int cl_punchangle_applied
cvar_t v_isometric_rot_pitch
static void highpass3(vec3_t value, vec_t fracx, vec_t fracy, vec_t fracz, vec3_t store, vec3_t out)
cvar_t cl_bob_limit_heightcheck
cvar_t cl_viewmodel_scale
cvar_t cl_bobfallminspeed
cvar_t v_isometric_verticalfov
cvar_t cl_leanmodel_up_highpass1
cvar_t cl_leanmodel_up_lowpass
void V_CalcRefdefUsing(const matrix4x4_t *entrendermatrix, const vec3_t clviewangles, qbool teleported, qbool clonground, qbool clcmdjump, float clstatsviewheight, qbool cldead, const vec3_t clvelocity)
cvar_t v_isometric_flipcullface
cvar_t cl_followmodel_up_highpass1
cvar_t cl_leanmodel_side_limit
void V_StartPitchDrift(void)
cvar_t cl_leanmodel_up_limit
cvar_t v_isometric_usevieworiginculling
cvar_t cl_followmodel_up_lowpass
void V_FadeViewFlashs(void)
static void V_CalcIntermissionRefdef(vec3_t vieworg, vec3_t viewangles, const matrix4x4_t *entrendermatrix, float clstatsviewheight)
static void V_BonusFlash_f(cmd_state_t *cmd)
void V_MakeViewIsometric(void)
static void V_cshift_f(cmd_state_t *cmd)
static void lowpass3(vec3_t value, vec_t fracx, vec_t fracy, vec_t fracz, vec3_t store, vec3_t out)
cvar_t cl_leanmodel_side_highpass1
void V_StopPitchDrift(void)
cvar_t cl_leanmodel_side_speed
cvar_t cl_followmodel_side_speed
cvar_t v_isometric_rot_roll
cvar_t cl_followmodel_side_lowpass
matrix4x4_t viewmodelmatrix_withbob
matrix4x4_t viewmodelmatrix_nobob
cvar_t cl_stairsmoothspeed
static vec_t highpass_limited(vec_t value, vec_t frac, vec_t limit, vec_t *store)
cvar_t cl_bobmodel_classic
cvar_t cl_followmodel_side_limit
cvar_t cl_leanmodel_side_lowpass
cvar_t cl_smoothviewheight
cvar_t cl_leanmodel_side_highpass
static vec_t highpass(vec_t value, vec_t frac, vec_t *store)
cvar_t v_isometric_rot_yaw
static vec_t lowpass(vec_t value, vec_t frac, vec_t *store)
cvar_t v_isometric_locked_orientation
cvar_t cl_followmodel_side_highpass1
cvar_t cl_followmodel_up_highpass
cvar_t cl_followmodel_up_limit
void V_CalcViewBlend(void)
cvar_t cl_followmodel_side_highpass