1 /*
2 ===========================================================================
3 Copyright (C) 1999-2005 Id Software, Inc.
4 Copyright (C) 2000-2006 Tim Angus
5 
6 This file is part of Tremulous.
7 
8 Tremulous is free software; you can redistribute it
9 and/or modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the License,
11 or (at your option) any later version.
12 
13 Tremulous is distributed in the hope that it will be
14 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Tremulous; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21 ===========================================================================
22 */
23 
24 // bg_local.h -- local definitions for the bg (both games) files
25 
26 #define MIN_WALK_NORMAL 0.7f   // can't walk on very steep slopes
27 
28 #define STEPSIZE    18
29 
30 #define TIMER_LAND        130
31 #define TIMER_GESTURE     (34*66+50)
32 #define TIMER_ATTACK      500 //nonsegmented models
33 
34 #define OVERCLIP    1.001f
35 
36 #define FALLING_THRESHOLD -900.0f //what vertical speed to start falling sound at
37 
38 
39 // all of the locals will be zeroed before each
40 // pmove, just to make damn sure we don't have
41 // any differences when running on client or server
42 typedef struct
43 {
44   vec3_t    forward, right, up;
45   float     frametime;
46 
47   int       msec;
48 
49   qboolean  walking;
50   qboolean  groundPlane;
51   qboolean  ladder;
52   trace_t   groundTrace;
53 
54   float     impactSpeed;
55 
56   vec3_t    previous_origin;
57   vec3_t    previous_velocity;
58   int       previous_waterlevel;
59 } pml_t;
60 
61 extern  pmove_t       *pm;
62 extern  pml_t         pml;
63 
64 // movement parameters
65 extern  float pm_stopspeed;
66 extern  float pm_duckScale;
67 extern  float pm_swimScale;
68 extern  float pm_wadeScale;
69 
70 extern  float pm_accelerate;
71 extern  float pm_airaccelerate;
72 extern  float pm_wateraccelerate;
73 extern  float pm_flyaccelerate;
74 
75 extern  float pm_friction;
76 extern  float pm_waterfriction;
77 extern  float pm_flightfriction;
78 
79 extern  int   c_pmove;
80 
81 void PM_ClipVelocity( vec3_t in, vec3_t normal, vec3_t out, float overbounce );
82 void PM_AddTouchEnt( int entityNum );
83 void PM_AddEvent( int newEvent );
84 
85 qboolean  PM_SlideMove( qboolean gravity );
86 void      PM_StepEvent( vec3_t from, vec3_t to, vec3_t normal );
87 qboolean  PM_StepSlideMove( qboolean gravity, qboolean predictive );
88 qboolean  PM_PredictStepMove( void );
89