// GAME_GOODVSBAD2
cvar_t chase_stevie = {0, "chase_stevie", "0"};
+cvar_t v_deathtilt = {0, "v_deathtilt", "1"};
+
float v_dmg_time, v_dmg_roll, v_dmg_pitch;
}
// calculate view angle kicks
- if (cl.viewentity >= 0 && cl.viewentity < MAX_EDICTS && cl_entities[cl.viewentity].state_current.active)
+ if (cl_entities[cl.viewentity].state_current.active)
{
ent = &cl_entities[cl.viewentity];
Matrix4x4_Transform(&ent->render.inversematrix, from, localfrom);
static float oldz;
entity_t *ent;
float vieworg[3], viewangles[3];
+ trace_t trace;
Matrix4x4_CreateIdentity(&viewmodelmatrix);
Matrix4x4_CreateIdentity(&r_refdef.viewentitymatrix);
if (cls.state == ca_connected && cls.signon == SIGNONS)
if (chase_active.value)
{
// observing entity from third person
- vec_t camback, camup, dist, forward[3], stop[3], chase_dest[3], normal[3];
+ vec_t camback, camup, dist, forward[3], chase_dest[3];
camback = bound(0, chase_back.value, 128);
if (chase_back.value != camback)
chase_dest[0] = vieworg[0] + forward[0] * dist;
chase_dest[1] = vieworg[1] + forward[1] * dist;
chase_dest[2] = vieworg[2] + forward[2] * dist + camup;
- CL_TraceLine(vieworg, chase_dest, stop, normal, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY);
- vieworg[0] = stop[0] + forward[0] * 8 + normal[0] * 4;
- vieworg[1] = stop[1] + forward[1] * 8 + normal[1] * 4;
- vieworg[2] = stop[2] + forward[2] * 8 + normal[2] * 4;
+ trace = CL_TraceBox(vieworg, vec3_origin, vec3_origin, chase_dest, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY, false);
+ VectorMAMAM(1, trace.endpos, 8, forward, 4, trace.plane.normal, vieworg);
}
else
{
// first person view from entity
// angles
- if (cl.stats[STAT_HEALTH] <= 0 && gamemode != GAME_FNIGGIUM)
+ if (cl.stats[STAT_HEALTH] <= 0 && v_deathtilt.integer)
viewangles[ROLL] = 80; // dead view angle
VectorAdd(viewangles, cl.punchangle, viewangles);
- viewangles[ROLL] += V_CalcRoll(cl.viewangles, cl.velocity);
+ viewangles[ROLL] += V_CalcRoll(cl.viewangles, cl.movement_velocity);
if (v_dmg_time > 0)
{
viewangles[ROLL] += v_dmg_time/v_kicktime.value*v_dmg_roll;
cycle = sin(M_PI + M_PI * (cycle-cl_bobup.value)/(1.0 - cl_bobup.value));
// bob is proportional to velocity in the xy plane
// (don't count Z, or jumping messes it up)
- bob = sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]) * cl_bob.value;
+ bob = sqrt(cl.movement_velocity[0]*cl.movement_velocity[0] + cl.movement_velocity[1]*cl.movement_velocity[1]) * cl_bob.value;
bob = bob*0.3 + bob*0.7*cycle;
vieworg[2] += bound(-7, bob, 4);
}
Cvar_RegisterVariable (&chase_active);
if (gamemode == GAME_GOODVSBAD2)
Cvar_RegisterVariable (&chase_stevie);
+
+ Cvar_RegisterVariable (&v_deathtilt);
}