]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Set better defaults and fix final comments. I think this should be ready for testing...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jul 2010 18:04:07 +0000 (18:04 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jul 2010 18:04:07 +0000 (18:04 +0000)
NOTE: If anyone wishes to see the effect better, set cl_bobroll to a higher value (eg. 0.01)

From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

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

darkplaces.txt
view.c

index ae8dc9b3a49f28950e215bdc30de34fd8ce6c9e3..54bc457ffc6e0881a34ff76e5b5f2d40bc74dac6 100644 (file)
@@ -396,6 +396,9 @@ cl_beams_polygons                                 1                   use beam p
 cl_beams_quakepositionhack                        1                   makes your lightning gun appear to fire from your waist (as in Quake and QuakeWorld)
 cl_bob                                            0.02                view bobbing amount
 cl_bobcycle                                       0.6                 view bobbing speed
+cl_bobroll                                        0.001               view rolling amount
+cl_bobrollcycle                                   0.75                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 7d96c8c684a676597983de5f51baec86883c2ba2..55a8a0c068fecc53e77164839940a6c6eb188d24 100644 (file)
--- a/view.c
+++ b/view.c
@@ -39,8 +39,8 @@ cvar_t cl_rollangle = {0, "cl_rollangle", "2.0", "how much to tilt the view when
 cvar_t cl_bob = {CVAR_SAVE, "cl_bob","0.02", "view bobbing amount"};
 cvar_t cl_bobcycle = {CVAR_SAVE, "cl_bobcycle","0.6", "view bobbing speed"};
 cvar_t cl_bobup = {CVAR_SAVE, "cl_bobup","0.5", "view bobbing adjustment that makes the up or down swing of the bob last longer"};
-cvar_t cl_bobroll = {CVAR_SAVE, "cl_bobroll","0.01", "view rolling amount"};
-cvar_t cl_bobrollcycle = {CVAR_SAVE, "cl_bobrollcycle","0.5", "view rolling speed"};
+cvar_t cl_bobroll = {CVAR_SAVE, "cl_bobroll","0.001", "view rolling amount"};
+cvar_t cl_bobrollcycle = {CVAR_SAVE, "cl_bobrollcycle","0.75", "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"};
@@ -666,9 +666,6 @@ void V_CalcRefdef (void)
                                        }
 
                                        // view rolling code
-                                       // TODO 1 (DONE): Make it work around the center rather than the left side
-                                       // TODO 2 (DONE): Make the roll smoothly return to 0 when you stop touching the ground, rather than instantly
-                                       // TODO 3: Write cvars to darkplaces.txt, set better defaults and possibly disable by default once the first TODOs are ready
                                        if (cl_bobroll.value && cl_bobrollcycle.value)
                                        {
                                                cycle2 = cl.time / cl_bobrollcycle.value;
@@ -678,6 +675,8 @@ void V_CalcRefdef (void)
                                                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.bobroll_airtime = 1;
                                                else