+// make the camera smoothly lower itself when we get swallowed\r
+// the target we are going for is from normal view offset to half of the view offset (because half is the best positioning of the view for the stomach model)\r
+.float cameraeffect_current, cameraeffect_target;\r
+void Vore_CameraEffect_Set(entity e)\r
+{\r
+ e.cameraeffect_current = 1;\r
+ e.cameraeffect_target = 2;\r
+}\r
+void Vore_CameraEffect_Apply()\r
+{\r
+ if(self.eater.classname != "player")\r
+ return;\r
+\r
+ if(self.cvar_cl_vore_cameraspeed)\r
+ {\r
+ local float step;\r
+ step = self.cvar_cl_vore_cameraspeed * frametime;\r
+\r
+ // not sure if these maths are good, as the effect should be smoother\r
+ if(self.cameraeffect_current >= self.cameraeffect_target + step)\r
+ self.cameraeffect_current -= step;\r
+ else if(self.cameraeffect_current <= self.cameraeffect_target - step)\r
+ self.cameraeffect_current += step;\r
+ }\r
+ else\r
+ self.cameraeffect_current = self.cameraeffect_target;\r
+\r
+ self.view_ofs_z = self.vore_oldview_ofs_z / self.cameraeffect_current;\r
+}\r
+\r