s->effects |= EF_DIMLIGHT;
}
+extern cvar_t cl_rollangle;
+extern cvar_t cl_rollspeed;
+
void EntityStateQW_ReadPlayerUpdate(void)
{
int slot = MSG_ReadByte(&cl_message);
s->angles[0] = viewangles[0] * -0.0333;
s->angles[1] = viewangles[1];
s->angles[2] = 0;
- s->angles[2] = V_CalcRoll(s->angles, velocity)*4;
+ s->angles[2] = Com_CalcRoll(s->angles, velocity, cl_rollangle.value, cl_rollspeed.value)*4;
// if this is an update on our player, update interpolation state
if (enumber == cl.playerentity)
S_Init();
CDAudio_Init();
Key_Init();
-
+ V_Init();
cls.levelmempool = Mem_AllocPool("client (per-level memory)", 0, NULL);
cls.permanentmempool = Mem_AllocPool("client (long term memory)", 0, NULL);
void V_StopPitchDrift (void);
void V_Init (void);
-float V_CalcRoll (const vec3_t angles, const vec3_t velocity);
void V_UpdateBlends (void);
void V_ParseDamage (void);
return 0;
}
+/*
+===============
+Com_CalcRoll
+
+Used by view and sv_user
+===============
+*/
+float Com_CalcRoll (const vec3_t angles, const vec3_t velocity, const vec_t angleval, const vec_t velocityval)
+{
+ vec3_t right;
+ float sign;
+ float side;
+
+ AngleVectors (angles, NULL, right, NULL);
+ side = DotProduct (velocity, right);
+ sign = side < 0 ? -1 : 1;
+ side = fabs(side);
+
+ if (side < velocityval)
+ side = side * angleval / velocityval;
+ else
+ side = angleval;
+
+ return side*sign;
+
+}
+
//===========================================================================
/*
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+float Com_CalcRoll (const vec3_t angles, const vec3_t velocity, const vec_t angleval, const vec_t velocityval);
+
#endif
Mod_Init();
World_Init();
SV_Init();
- V_Init(); // some cvars needed by server player physics (cl_rollangle etc)
Host_InitLocal();
Host_ServerOptions();
cvar_t timelimit = {CVAR_SERVER | CVAR_NOTIFY, "timelimit","0", "ends level at this time (in minutes)"};
cvar_t sv_threaded = {CVAR_SERVER, "sv_threaded", "0", "enables a separate thread for server code, improving performance, especially when hosting a game while playing, EXPERIMENTAL, may be crashy"};
+cvar_t sv_rollspeed = {CVAR_CLIENT, "sv_rollspeed", "200", "how much strafing is necessary to tilt the view"};
+cvar_t sv_rollangle = {CVAR_CLIENT, "sv_rollangle", "2.0", "how much to tilt the view when strafing"};
+
cvar_t saved1 = {CVAR_SERVER | CVAR_SAVE, "saved1", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
cvar_t saved2 = {CVAR_SERVER | CVAR_SAVE, "saved2", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
cvar_t saved3 = {CVAR_SERVER | CVAR_SAVE, "saved3", "0", "unused cvar in quake that is saved to config.cfg on exit, can be used by mods"};
Cvar_RegisterVariable (&timelimit);
Cvar_RegisterVariable (&sv_threaded);
+ Cvar_RegisterVariable (&sv_rollangle);
+ Cvar_RegisterVariable (&sv_rollspeed);
+
Cvar_RegisterVariable (&saved1);
Cvar_RegisterVariable (&saved2);
Cvar_RegisterVariable (&saved3);
static usercmd_t usercmd;
extern cvar_t sv_autodemo_perclient;
+extern cvar_t sv_rollangle;
+extern cvar_t sv_rollspeed;
/*
==================
VectorAdd (PRVM_serveredictvector(host_client->edict, v_angle), PRVM_serveredictvector(host_client->edict, punchangle), v_angle);
VectorCopy(PRVM_serveredictvector(host_client->edict, angles), angles);
VectorCopy(PRVM_serveredictvector(host_client->edict, velocity), velocity);
- PRVM_serveredictvector(host_client->edict, angles)[ROLL] = V_CalcRoll (angles, velocity)*4;
+ PRVM_serveredictvector(host_client->edict, angles)[ROLL] = Com_CalcRoll (angles, velocity, sv_rollangle.value, sv_rollspeed.value)*4;
if (!PRVM_serveredictfloat(host_client->edict, fixangle))
{
PRVM_serveredictvector(host_client->edict, angles)[PITCH] = -v_angle[PITCH]/3;
int cl_punchangle_applied;
-/*
-===============
-V_CalcRoll
-
-Used by view and sv_user
-===============
-*/
-float V_CalcRoll (const vec3_t angles, const vec3_t velocity)
-{
- vec3_t right;
- float sign;
- float side;
- float value;
-
- AngleVectors (angles, NULL, right, NULL);
- side = DotProduct (velocity, right);
- sign = side < 0 ? -1 : 1;
- side = fabs(side);
-
- value = cl_rollangle.value;
-
- if (side < cl_rollspeed.value)
- side = side * value / cl_rollspeed.value;
- else
- side = value;
-
- return side*sign;
-
-}
-
void V_StartPitchDrift (void)
{
if (cl.laststop == cl.time)
VectorAdd(viewangles, cl.punchangle, viewangles);
cl_punchangle_applied = 1;
}
- viewangles[ROLL] += V_CalcRoll(clviewangles, clvelocity);
+ viewangles[ROLL] += Com_CalcRoll(clviewangles, clvelocity, cl_rollangle.value, cl_rollspeed.value);
if (v_dmg_time > 0)
{