]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'refs/remotes/origin/fruitiex/leanmodelcfg'
authorRudolf Polzer <divverent@alientrap.org>
Thu, 27 May 2010 20:29:09 +0000 (22:29 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 27 May 2010 20:29:09 +0000 (22:29 +0200)
defaultXonotic.cfg
qcsrc/server/cl_physics.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_jumppads.qc

index a30856168a8ffc87bbfcf16a49e039176a04e3dc..43d6e0c8a95fe56a91ecdeda9552f009775b2ac7 100644 (file)
@@ -240,7 +240,28 @@ cl_bobcycle 0 // how long the cycle of up/down view movement takes (only works i
 cl_bob 0.01 // how much view moves up/down when moving (does not move if cl_bobcycle is 0, but still enables cl_bobmodel), default is 0.02
 cl_bobmodel 1 // whether to have gun model move around on screen when moving (only works if cl_bob is not 0), default is 1
 cl_leanmodel 1 // enables weapon leaning effect when looking around
+cl_leanmodel_side_speed 1 "gun leaning sideways speed"
+cl_leanmodel_side_limit 35 "gun leaning sideways limit"
+cl_leanmodel_side_highpass1 30 "gun leaning sideways pre-highpass in 1/s"
+cl_leanmodel_side_highpass 3 "gun leaning sideways highpass in 1/s"
+cl_leanmodel_side_lowpass 20 "gun leaning sideways lowpass in 1/s"
+cl_leanmodel_up_speed 1 "gun leaning upward speed"
+cl_leanmodel_up_limit 50 "gun leaning upward limit"
+cl_leanmodel_up_highpass1 5 "gun leaning upward pre-highpass in 1/s"
+cl_leanmodel_up_highpass 15 "gun leaning upward highpass in 1/s"
+cl_leanmodel_up_lowpass 20 "gun leaning upward lowpass in 1/s"
 cl_followmodel 1 // enables weapon pushing / pulling effect when walking
+cl_followmodel_side_speed 0.5 "gun following sideways speed"
+cl_followmodel_side_limit 6 "gun following sideways limit"
+cl_followmodel_side_highpass1 30 "gun following sideways pre-highpass in 1/s"
+cl_followmodel_side_highpass 5 "gun following sideways highpass in 1/s"
+cl_followmodel_side_lowpass 10 "gun following sideways lowpass in 1/s"
+cl_followmodel_up_speed 1 "gun following upward speed"
+cl_followmodel_up_limit 5 "gun following upward limit"
+cl_followmodel_up_highpass1 60 "gun following upward pre-highpass in 1/s"
+cl_followmodel_up_highpass 2 "gun following upward highpass in 1/s"
+cl_followmodel_up_lowpass 10 "gun following upward lowpass in 1/s"
+
 cl_rollangle 0 // amount of view tilt when strafing, default is 2.0
 v_kicktime 0 // how long damage kicks of the view last, default is 0 seconds
 gl_polyblend 0.5 // whether to use screen tints, default is 1
@@ -330,9 +351,9 @@ set sv_player_crouch_maxs "16 16 25" "maxs of a crouched playermodel"
 
 set sv_pogostick 1 "don't require releasing the space bar for jumping again"
 set sv_doublejump 0 "allow Quake 2-style double jumps"
-set sv_jumpspeedcap_min "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this"
-set sv_jumpspeedcap_max "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this"
-set sv_jumpspeedcap_max_disable_on_ramps 0 "disable max jumpspeedcap on ramps to preserve the old rampjump style"
+set sv_jumpspeedcap_min "" "lower bound on the baseline velocity of a jump; final velocity will be >= (jumpheight * min + jumpheight)"
+set sv_jumpspeedcap_max "" "upper bound on the baseline velocity of a jump; final velocity will be <= (jumpheight * max + jumpheight)"
+set sv_jumpspeedcap_max_disable_on_ramps 0 "disable upper baseline velocity bound on ramps to preserve the old rampjump style"
 
 seta sv_precacheplayermodels 1
 seta sv_precacheweapons 0
index d3425451c15c94419b1b16fd3c3821e9c441e97d..0051d8759a4d9a3a9384152d53e848d0a8427dc4 100644 (file)
@@ -41,6 +41,15 @@ When you press the jump key
 void PlayerJump (void)
 {
        float mjumpheight;
+       float doublejump;
+
+       doublejump = FALSE;
+       if (sv_doublejump)
+       {
+               tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
+               if (trace_fraction < 1 && trace_plane_normal_z > 0.7)
+                       doublejump = TRUE;
+       }
 
        mjumpheight = cvar("sv_jumpvelocity");
        if (self.waterlevel >= WATERLEVEL_SWIMMING)
@@ -55,6 +64,7 @@ void PlayerJump (void)
                return;
        }
 
+       if (!doublejump)
        if (!(self.flags & FL_ONGROUND))
                return;
 
@@ -85,16 +95,34 @@ void PlayerJump (void)
                mjumpheight = mjumpheight * cvar("g_minstagib_speed_jumpheight");
        }
 
+       // sv_jumpspeedcap_min/sv_jumpspeedcap_max act as baseline
+       // velocity bounds.  Final velocity is bound between (jumpheight *
+       // min + jumpheight) and (jumpheight * max + jumpheight);
+
        if(cvar_string("sv_jumpspeedcap_min") != "")
-               self.velocity_z = max(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_min"), self.velocity_z);
-       if(cvar_string("sv_jumpspeedcap_max") != "") {
+       {
+               float minjumpspeed;
+
+               minjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_min");
+
+               if (self.velocity_z < minjumpspeed)
+                       mjumpheight += minjumpspeed - self.velocity_z;
+       }
+
+       if(cvar_string("sv_jumpspeedcap_max") != "")
+       {
+               // don't do jump speedcaps on ramps to preserve old xonotic ramjump style
                tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
-               if(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")) {
-                       // don't do jump speedcaps on ramps to preserve old xonotic ramjump style
-                       //print("Trace plane normal z: ", ftos(trace_plane_normal_z), ", disabling speed cap!\n");
+
+               if(!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")))
+               {
+                       float maxjumpspeed;
+
+                       maxjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_max");
+
+                       if (self.velocity_z > maxjumpspeed)
+                               mjumpheight -= self.velocity_z - maxjumpspeed;
                }
-               else
-                       self.velocity_z = min(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_max"), self.velocity_z) + trace_ent.velocity_z;
        }
 
        if(!(self.lastflags & FL_ONGROUND))
@@ -605,7 +633,6 @@ void race_send_speedaward_alltimebest(float msg)
 string GetMapname(void);
 float speedaward_lastupdate;
 float speedaward_lastsent;
-.float jumppadusetime;
 var float autocvar_g_movement_highspeed = 1;
 void SV_PlayerPhysics()
 {
@@ -859,14 +886,6 @@ void SV_PlayerPhysics()
 
        if(self.classname == "player")
        {
-               if(sv_doublejump && time - self.jumppadusetime > 2 * sys_frametime)
-               {
-                       tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
-                       self.flags &~= FL_ONGROUND;
-                       if(trace_fraction < 1 && trace_plane_normal_z > 0.7)
-                               self.flags |= FL_ONGROUND;
-               }
-
                if (self.BUTTON_JUMP)
                        PlayerJump ();
                else
index ac0bc8f6338fd0ae04a47ae8c4684701114788f7..fa61ad8712783892d3b916701f75a163e42d2ab3 100644 (file)
@@ -1227,7 +1227,6 @@ void readlevelcvars(void)
        sv_maxidle = cvar("sv_maxidle");
        sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
        sv_pogostick = cvar("sv_pogostick");
-       sv_doublejump = cvar("sv_doublejump");
        g_ctf_reverse = cvar("g_ctf_reverse");
        sv_autotaunt = cvar("sv_autotaunt");
        sv_taunt = cvar("sv_taunt");
index 0212fce8a43fa7fe3e78951aa77e273f57e01468..f4cc8744518593fcb456907ece1c026174ab059e 100644 (file)
@@ -200,6 +200,7 @@ void StartFrame (void)
        sv_warsowbunny_backtosideratio = cvar("sv_warsowbunny_backtosideratio");
        teamplay = cvar ("teamplay");
        sys_frametime = cvar("sys_ticrate") * cvar("slowmo");
+       sv_doublejump = cvar("sv_doublejump");
 
        if (timeoutStatus == 1) // just before the timeout (when timeoutStatus will be 2)
                orig_slowmo = cvar("slowmo"); // slowmo will be restored after the timeout
index 4faba6d71c4aa288b55527721711721a019377e7..9bb8f7c92034d88e0de65ba2f88e0039ed4f53f5 100644 (file)
@@ -152,7 +152,6 @@ void trigger_push_touch()
        other.flags &~= FL_ONGROUND;
 
        other.velocity = self.movedir;
-       other.jumppadusetime = time;
 
        if (other.classname == "player")
        {