Nuclide
Software Development Kit for id Tech
pmove.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016-2022 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
18.float watertype;
19.float maxspeed;
20.vector view_ofs;
24
25
33typedef enum
34{
40
41
43class
45{
46public:
47 void NSPMoveVars(void);
48
49 NETWORKED_FLOAT(g_gravity)
50 NETWORKED_FLOAT(pm_accelerate)
51 NETWORKED_FLOAT(pm_airaccelerate)
52 NETWORKED_FLOAT(pm_airstepsize)
53 NETWORKED_FLOAT(pm_boxcenter)
54 NETWORKED_FLOAT(pm_boxwidth)
55 NETWORKED_FLOAT(pm_crouchheight)
56 NETWORKED_FLOAT(pm_crouchspeed)
57 NETWORKED_FLOAT(pm_crouchviewheight)
58 NETWORKED_FLOAT(pm_edgefriction)
59 NETWORKED_FLOAT(pm_friction)
60 NETWORKED_FLOAT(pm_gravity)
61 NETWORKED_FLOAT(pm_jumpheight)
62 NETWORKED_FLOAT(pm_maxviewpitch)
63 NETWORKED_FLOAT(pm_minviewpitch)
64 NETWORKED_FLOAT(pm_noclipaccelerate)
65 NETWORKED_FLOAT(pm_noclipspeed)
66 NETWORKED_FLOAT(pm_normalheight)
67 NETWORKED_FLOAT(pm_normalviewheight)
68 NETWORKED_FLOAT(pm_nospeedcap)
69 NETWORKED_FLOAT(pm_proneheight)
70 NETWORKED_FLOAT(pm_pronespeed)
71 NETWORKED_FLOAT(pm_proneviewheight)
72 NETWORKED_FLOAT(pm_runspeed)
73 NETWORKED_FLOAT(pm_stamina)
74 NETWORKED_FLOAT(pm_staminarate)
75 NETWORKED_FLOAT(pm_staminathreshold)
76 NETWORKED_FLOAT(pm_stepsize)
77 NETWORKED_FLOAT(pm_stopspeed)
78 NETWORKED_FLOAT(pm_walkspeed)
79 NETWORKED_FLOAT(pm_wateraccelerate)
80 NETWORKED_FLOAT(pm_waterjumpheight)
81
82
83 nonvirtual vector GetStandingMins(void);
85 nonvirtual vector GetStandingMaxs(void);
87 nonvirtual vector GetStandingViewOffset(void);
89 nonvirtual vector GetCrouchMins(void);
91 nonvirtual vector GetCrouchMaxs(void);
93 nonvirtual vector GetCrouchViewOffset(void);
95 nonvirtual vector GetProneMins(void);
97 nonvirtual vector GetProneMaxs(void);
99 nonvirtual vector GetProneViewOffset(void);
100
101#ifdef SERVER
102 virtual void EvaluateEntity(void);
103 virtual bool SendEntity(entity, float);
104#endif
105
106#ifdef CLIENT
107 virtual void ReceiveEntity(float, float);
108#endif
109
110private:
111 nonvirtual void UpdateBoundingBoxes(void);
112
113 vector m_vecStandingMins;
114 vector m_vecStandingMaxs;
115 vector m_vecCrouchMins;
116 vector m_vecCrouchMaxs;
117 vector m_vecProneMins;
118 vector m_vecProneMaxs;
119 vector m_vecNormalViewOffset;
120 vector m_vecCrouchViewOffset;
121 vector m_vecProneViewOffset;
122};
123
126
128void PMove_Init(void);
129
132 // end of pmove
NSEntity is the lowest of the user-accessible entity class.
Definition: NSEntity.h:54
This class networks pmove related variables to each client.
Definition: pmove.h:45
waterlevel_t
Definition: pmove.h:34
void PMoveCustom_RunCrouchPhysics(entity)
Definition: pmove_custom.qc:721
void PMove_Init(void)
Called by Nuclide.
Definition: pmove.qc:442
NSPMoveVars g_pmoveVars
The global, shared object containing all currently valid pmove parameters.
Definition: pmove.h:125
void PMoveCustom_RunPlayerPhysics(entity)
Definition: pmove_custom.qc:669
@ WATERLEVEL_KNEE
Definition: pmove.h:36
@ WATERLEVEL_SUBMERGED
Definition: pmove.h:38
@ WATERLEVEL_CHEST
Definition: pmove.h:37
@ WATERLEVEL_OUTSIDE
Definition: pmove.h:35
vector view_ofs
Definition: pmove.h:20
float maxspeed
Definition: pmove.h:19
float watertype
Definition: pmove.h:18
float waterlevel
Definition: pmove.h:17
entity groundentity
Definition: pmove.h:23
int trace_endcontentsi
Definition: pmove.h:21
vector basevelocity
Definition: pmove.h:22
#define NETWORKED_FLOAT(x)
Definition: defs.h:21