]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Remove the rolling in favor of the side-bobbing. I don't believe both effects would...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jul 2010 18:07:40 +0000 (18:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jul 2010 18:07:40 +0000 (18:07 +0000)
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

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

client.h
darkplaces.txt
view.c

index b485f5f60af9b887ace985ca3c45b6ec31585cc2..c1699bba16fd4a9fe216eb822330f712926f92e4 100644 (file)
--- a/client.h
+++ b/client.h
@@ -979,7 +979,6 @@ typedef struct client_state_s
        double hitgroundtime;
 
        // used by bobside and bobroll
-       float bobroll_airtime;
        float bobside_airtime;
 
        // don't change view angle, full screen, etc
index d3b88c5e4e2c039951cd65e9ce3cd76895cc63fd..e94d8b390dbcf273faa91d3ad3a64f57717d6339 100644 (file)
@@ -399,9 +399,6 @@ cl_bobcycle                                       0.6                 view bobbi
 cl_bobside                                        0                   sideway view bobbing amount
 cl_bobsidecycle                                   0.6                 sideway view bobbing speed
 cl_bobsideairtime                                 0.05                how fast the view goes back when you stop touching the ground
-cl_bobroll                                        0                   view rolling amount
-cl_bobrollcycle                                   0.8                 view rolling speed
-cl_bobrollairtime                                 0.05                how fast the view rolls 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 5d558aaccecd1454ad4b1d5bb0015f79f653098d..c755001b06965c972dec6640a8267ac12ce92df4 100644 (file)
--- a/view.c
+++ b/view.c
@@ -43,9 +43,6 @@ cvar_t cl_bobside = {CVAR_SAVE, "cl_bobside","0", "sideway view bobbing amount"}
 cvar_t cl_bobsidecycle = {CVAR_SAVE, "cl_bobsidecycle","0.6", "sideway view bobbing speed"};
 cvar_t cl_bobsideup = {CVAR_SAVE, "cl_bobsideup","0.5", "view bobbing adjustment that makes the side swing of the bob last longer"};
 cvar_t cl_bobsideairtime = {CVAR_SAVE, "cl_bobsideairtime","0.05", "how fast the view goes back when you stop touching the ground"};
-cvar_t cl_bobroll = {CVAR_SAVE, "cl_bobroll","0", "view rolling amount"};
-cvar_t cl_bobrollcycle = {CVAR_SAVE, "cl_bobrollcycle","0.8", "view rolling speed"};
-cvar_t cl_bobrollairtime = {CVAR_SAVE, "cl_bobrollairtime","0.05", "how fast the view rolls 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"};
@@ -591,8 +588,8 @@ void V_CalcRefdef (void)
                                VectorAdd(vieworg, cl.punchvector, vieworg);
                                if (cl.stats[STAT_HEALTH] > 0)
                                {
-                                       double xyspeed, bob, bobroll;
-                                       float cycle, cycle2;
+                                       double xyspeed, bob;
+                                       float cycle;
                                        vec_t frametime;
 
                                        frametime = cl.realframetime * cl.movevars_timescale;
@@ -720,33 +717,6 @@ void V_CalcRefdef (void)
                                                gunorg[1] += bound(-8, bobvel[1], 8);
                                        }
 
-                                       // view rolling code
-                                       if (cl_bobroll.value && cl_bobrollcycle.value)
-                                       {
-                                               cycle2 = cl.time / cl_bobrollcycle.value;
-                                               cycle2 -= (int) cycle2;
-                                               if (cycle2 < 0.5)
-                                                       cycle2 = sin(M_PI * cycle2 / 0.5);
-                                               else
-                                                       cycle2 = sin(M_PI + M_PI * (cycle2-0.5)/0.5);
-
-                                               // 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.bobroll_airtime = 1;
-                                               else
-                                               {
-                                                       if(cl.bobroll_airtime > 0)
-                                                               cl.bobroll_airtime -= bound(0, cl_bobrollairtime.value, 1);
-                                                       else
-                                                               cl.bobroll_airtime = 0;
-                                               }
-
-                                               cycle2 *= cl_bobroll.value * cl.bobroll_airtime;
-                                               bobroll = bound(0, xyspeed, sv_maxspeed.value) * cycle2;
-                                               viewangles[2] += bound(-15, bobroll, 15);
-                                       }
-
                                        // gun model bobbing code
                                        if (cl_bob.value && cl_bobmodel.value)
                                        {
@@ -985,9 +955,6 @@ void V_Init (void)
        Cvar_RegisterVariable (&cl_bobsidecycle);
        Cvar_RegisterVariable (&cl_bobsideup);
        Cvar_RegisterVariable (&cl_bobsideairtime);
-       Cvar_RegisterVariable (&cl_bobroll);
-       Cvar_RegisterVariable (&cl_bobrollcycle);
-       Cvar_RegisterVariable (&cl_bobrollairtime);
        Cvar_RegisterVariable (&cl_bobmodel);
        Cvar_RegisterVariable (&cl_bobmodel_side);
        Cvar_RegisterVariable (&cl_bobmodel_up);