]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Tweak a definition and cvar
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jul 2010 18:07:55 +0000 (18:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jul 2010 18:07:55 +0000 (18:07 +0000)
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10304 d7cf8633-e32d-0410-b094-e92efae38249

client.h
darkplaces.txt
view.c

index 5e00c01136202085d35296f831757816973633a2..412d00eea9f590c3cc24206f79a345cf56776631 100644 (file)
--- a/client.h
+++ b/client.h
@@ -977,9 +977,7 @@ typedef struct client_state_s
        qboolean oldonground;
        double lastongroundtime;
        double hitgroundtime;
-
-       // used by bob2
-       float bob2_airtime;
+       float bob2_smooth;
 
        // don't change view angle, full screen, etc
        int intermission;
index e73aba1ce2043d4f14021d25daae3091a010f521..46d793ea48d8af160cc40afaf4237a5728dcd3d6 100644 (file)
@@ -398,7 +398,7 @@ cl_bob                                            0.02                view bobbi
 cl_bobcycle                                       0.6                 view bobbing speed
 cl_bob2                                           0                   sideway view bobbing amount
 cl_bob2cycle                                      0.6                 sideway view bobbing speed
-cl_bob2airtime                                    0.05                how fast the view goes back when you stop touching the ground
+cl_bob2smooth                                     0.05                how fast the view goes back when you stop touching the ground
 cl_bobmodel                                       1                   enables gun bobbing
 cl_bobmodel_side                                  0.05                gun bobbing sideways sway amount
 cl_bobmodel_speed                                 7                   gun bobbing speed
diff --git a/view.c b/view.c
index 9c897de7ef38a5c87d4946fe358f9999d54f9736..732c02ac998880dfc3443e31aa3955efa636f715 100644 (file)
--- a/view.c
+++ b/view.c
@@ -42,7 +42,7 @@ cvar_t cl_bobup = {CVAR_SAVE, "cl_bobup","0.5", "view bobbing adjustment that ma
 cvar_t cl_bob2 = {CVAR_SAVE, "cl_bob2","0", "sideway view bobbing amount"};
 cvar_t cl_bob2cycle = {CVAR_SAVE, "cl_bob2cycle","0.6", "sideway view bobbing speed"};
 cvar_t cl_bob2up = {CVAR_SAVE, "cl_bob2up","0.5", "view bobbing adjustment that makes the side swing of the bob last longer"};
-cvar_t cl_bob2airtime = {CVAR_SAVE, "cl_bob2airtime","0.05", "how fast the view goes back when you stop touching the ground"};
+cvar_t cl_bob2smooth = {CVAR_SAVE, "cl_bob2smooth","0.05", "how fast the view goes back when you stop touching the ground"};
 cvar_t cl_bobmodel = {CVAR_SAVE, "cl_bobmodel", "1", "enables gun bobbing"};
 cvar_t cl_bobmodel_side = {CVAR_SAVE, "cl_bobmodel_side", "0.15", "gun bobbing sideways sway amount"};
 cvar_t cl_bobmodel_up = {CVAR_SAVE, "cl_bobmodel_up", "0.06", "gun bobbing upward movement amount"};
@@ -686,20 +686,20 @@ void V_CalcRefdef (void)
                                                // this value slowly decreases from 1 to 0 when we stop touching the ground.
                                                // The cycle is later multiplied with it so the view smooths back to normal
                                                if (cl.onground && !cl.cmd.jump) // also block the effect while the jump button is pressed, to avoid twitches when bunny-hopping
-                                                       cl.bob2_airtime = 1;
+                                                       cl.bob2_smooth = 1;
                                                else
                                                {
-                                                       if(cl.bob2_airtime > 0)
-                                                               cl.bob2_airtime -= bound(0, cl_bob2airtime.value, 1);
+                                                       if(cl.bob2_smooth > 0)
+                                                               cl.bob2_smooth -= bound(0, cl_bob2smooth.value, 1);
                                                        else
-                                                               cl.bob2_airtime = 0;
+                                                               cl.bob2_smooth = 0;
                                                }
 
                                                // now we calculate the side and front of the player, between the X and Y axis
                                                AngleVectors(viewangles, forward, right, up);
                                                // now the speed based on these angles. The division is for mathing vertical bobbing intensity
-                                               side = DotProduct (cl.velocity, right) / 1000 * cl.bob2_airtime;
-                                               front = DotProduct (cl.velocity, forward) / 1000 * cl.bob2_airtime;
+                                               side = DotProduct (cl.velocity, right) / 1000 * cl.bob2_smooth;
+                                               front = DotProduct (cl.velocity, forward) / 1000 * cl.bob2_smooth;
                                                forward[0] *= bob;
                                                forward[1] *= bob;
                                                right[0] *= bob;
@@ -954,7 +954,7 @@ void V_Init (void)
        Cvar_RegisterVariable (&cl_bob2);
        Cvar_RegisterVariable (&cl_bob2cycle);
        Cvar_RegisterVariable (&cl_bob2up);
-       Cvar_RegisterVariable (&cl_bob2airtime);
+       Cvar_RegisterVariable (&cl_bob2smooth);
        Cvar_RegisterVariable (&cl_bobmodel);
        Cvar_RegisterVariable (&cl_bobmodel_side);
        Cvar_RegisterVariable (&cl_bobmodel_up);