From: MirceaKitsune Date: Tue, 3 May 2011 00:22:07 +0000 (+0300) Subject: Remove the smooth camera for prey entering the stomach. It was ugly to begin with... X-Git-Url: https://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=284013c0eaf7ee8a382cb76b2172b211b5d51492 Remove the smooth camera for prey entering the stomach. It was ugly to begin with, and now with sizes it risked being buggy too. View offset changes are already smoothed now (see view smoothing for crouching), so this was just a duplicate effect now. --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 8a18dcaa..16e9c69f 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -1527,7 +1527,6 @@ seta g_ghost_items 1 "enable ghosted items (when between 0 and 1, overrides the seta g_ghost_items_color "-1 -1 -1" "color of ghosted items, 0 0 0 leaves the color unchanged" set cl_vore_stomachmodel 1 "when enabled, we see the stomach model around us when eaten. -1 = disabled, 1 = enabled, anything between = alpha" -set cl_vore_cameraspeed 1.5 "speed at which you see yourself sliding down when swallowed, 0 disables" seta cl_vore_cutvolume_sound 0.75 "sound volume is reduced to this amount when you are in a stomach" seta cl_vore_cutvolume_music 0.25 "music volume is reduced to this amount when you are in a stomach" seta cl_vore_cutvolume_fade 0.1 "fading speed of the volume change" diff --git a/data/qcsrc/server/constants.qh b/data/qcsrc/server/constants.qh index 4248ff5b..154a6496 100644 --- a/data/qcsrc/server/constants.qh +++ b/data/qcsrc/server/constants.qh @@ -130,7 +130,7 @@ vector PL_MAX = '16 16 45'; vector PL_CROUCH_VIEW_OFS = '0 0 15'; vector PL_CROUCH_MIN = '-16 -16 -24'; vector PL_CROUCH_MAX = '16 16 25'; -vector PL_PREY_VIEW_OFS = '0 0 35'; +vector PL_PREY_VIEW_OFS = '0 0 17'; // Sajt - added these, just as constants. Not sure how you want them actually put in the game, but I just // did this so at least they worked diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index cbf049f3..a927ba95 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -335,7 +335,6 @@ float sv_clforceplayermodels; .float cvar_cl_gunalign; .float cvar_cl_noantilag; .float cvar_cl_vore_stomachmodel; -.float cvar_cl_vore_cameraspeed; .float cvar_cl_vore_autodigest; .float cvar_chase_active; diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index 0e9cf6cb..30755d2c 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -616,7 +616,6 @@ void GetCvars(float f) GetCvars_handleFloat(s, f, cvar_cl_accuracy_data_receive, "cl_accuracy_data_receive"); GetCvars_handleFloat(s, f, cvar_chase_active, "chase_active"); GetCvars_handleFloat(s, f, cvar_cl_vore_stomachmodel, "cl_vore_stomachmodel"); - GetCvars_handleFloat(s, f, cvar_cl_vore_cameraspeed, "cl_vore_cameraspeed"); GetCvars_handleFloat(s, f, cvar_cl_vore_autodigest, "cl_vore_autodigest"); self.cvar_cl_accuracy_data_share = boolean(self.cvar_cl_accuracy_data_share); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index eb9ab112..6c7e0c2c 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -119,36 +119,13 @@ float Vore_CanLeave() return FALSE; } -// make the camera smoothly lower itself when we get swallowed -// our aim is going from the normal view offset to half of the view offset (because half is the best positioning for the stomach model) -.float cameraeffect_current, cameraeffect_target; -void Vore_CameraEffect_Set(entity e) -{ - e.cameraeffect_current = 1; - e.cameraeffect_target = 2; -} -void Vore_CameraEffect_Apply() +// position the camera properly for prey +void Vore_SetCamera() { if not(self.predator.classname == "player" || self.fakeprey > 1) return; - if(self.cvar_cl_vore_cameraspeed) - { - local float step; - step = self.cvar_cl_vore_cameraspeed * frametime; - - // not sure if these maths are good, as the effect should be smoother - if(self.cameraeffect_current >= self.cameraeffect_target + step) - self.cameraeffect_current -= step; - else if(self.cameraeffect_current <= self.cameraeffect_target - step) - self.cameraeffect_current += step; - } - else - self.cameraeffect_current = self.cameraeffect_target; - - self.view_ofs_x = PL_PREY_VIEW_OFS_x; - self.view_ofs_y = PL_PREY_VIEW_OFS_y; - self.view_ofs_z = PL_PREY_VIEW_OFS_z / self.cameraeffect_current; + self.view_ofs = PL_PREY_VIEW_OFS; float prey_height; if(self.fakeprey > 1) @@ -219,8 +196,6 @@ void Vore_Swallow(entity e) if(e.flagcarried) DropFlag(e.flagcarried, world, e.predator); - Vore_CameraEffect_Set(e); - if(stov(cvar_string("g_vore_regurgitatecolor_release"))) e.colormod = stov(cvar_string("g_vore_regurgitatecolor_release")); @@ -632,7 +607,7 @@ void Vore() // Code that addresses the prey: // -------------------------------- - Vore_CameraEffect_Apply(); + Vore_SetCamera(); // keepdeadprey - detach dead prey if their predator died or got swallowed if(self.fakepredator.classname == "player")