From: Mario Date: Wed, 11 Nov 2020 23:24:42 +0000 (+1000) Subject: Add a rough frontal view mode to the chase camera X-Git-Tag: xonotic-v0.8.5~679 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0db9a35ff2f3f16359c11ef16b9d58267bc2fbed;p=xonotic%2Fxonotic-data.pk3dir.git Add a rough frontal view mode to the chase camera --- diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 303fc38f2..acd503c5a 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -434,6 +434,7 @@ float autocvar_chase_back; float autocvar_chase_up; bool autocvar_chase_overhead; float autocvar_chase_pitchangle; +bool autocvar_chase_front; vector CSQCPlayer_ApplyChase(entity this, vector v) { vector forward; @@ -479,6 +480,8 @@ vector CSQCPlayer_ApplyChase(entity this, vector v) { makevectors(view_angles); forward = v_forward; + if(autocvar_chase_front) + forward = normalize(forward * -1); // trace a little further so it hits a surface more consistently (to avoid 'snapping' on the edge of the range) float cdist = -autocvar_chase_back - 8; chase_dest.x = v.x + forward.x * cdist; @@ -488,6 +491,14 @@ vector CSQCPlayer_ApplyChase(entity this, vector v) v.x = 1 * trace_endpos.x + 8 * forward.x + 4 * trace_plane_normal.x; v.y = 1 * trace_endpos.y + 8 * forward.y + 4 * trace_plane_normal.y; v.z = 1 * trace_endpos.z + 8 * forward.z + 4 * trace_plane_normal.z; + + if(autocvar_chase_front) + { + // now flip the view so the player is looking at themselves + vector newang = vectoangles(forward); + view_angles.x = view_angles.x * -1; // inverse up-down looking direction + view_angles.y = newang.y; + } } #if 0 diff --git a/xonotic-client.cfg b/xonotic-client.cfg index bf1735e02..8f7066d96 100644 --- a/xonotic-client.cfg +++ b/xonotic-client.cfg @@ -216,6 +216,8 @@ seta cl_eventchase_vehicle 1 "camera goes into 3rd person mode when inside a veh seta cl_eventchase_vehicle_viewoffset "0 0 80" seta cl_eventchase_vehicle_distance 250 +seta chase_front 0 "show frontal view when using chase cam" + set _vehicles_shownchasemessage 0 seta cl_particles_oldvortexbeam 0 "Uses the old v2.3 Vortex beam instead of the new beam, only works if server allows it (g_allow_oldvortexbeam 1)"