Nuclide
Software Development Kit for id Technology
pmove.h
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
17.float waterlevel;
18.float watertype;
19.float maxspeed;
20.vector view_ofs;
21int trace_endcontentsi;
22.vector basevelocity;
23.entity groundentity;
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_runfiring)
74 NETWORKED_FLOAT(pm_stamina)
75 NETWORKED_FLOAT(pm_staminarate)
76 NETWORKED_FLOAT(pm_staminathreshold)
77 NETWORKED_FLOAT(pm_stepsize)
78 NETWORKED_FLOAT(pm_stopspeed)
79 NETWORKED_FLOAT(pm_walkspeed)
80 NETWORKED_FLOAT(pm_wateraccelerate)
81 NETWORKED_FLOAT(pm_waterjumpheight)
82
83
84 nonvirtual vector GetStandingMins(void);
86 nonvirtual vector GetStandingMaxs(void);
88 nonvirtual vector GetStandingViewOffset(void);
90 nonvirtual vector GetCrouchMins(void);
92 nonvirtual vector GetCrouchMaxs(void);
94 nonvirtual vector GetCrouchViewOffset(void);
96 nonvirtual vector GetProneMins(void);
98 nonvirtual vector GetProneMaxs(void);
100 nonvirtual vector GetProneViewOffset(void);
101
102#ifdef SERVER
103 virtual void EvaluateEntity(void);
104 virtual bool SendEntity(entity, float);
105#endif
106
107#ifdef CLIENT
108 virtual void ReceiveEntity(float, float);
109#endif
110
111private:
112 nonvirtual void Refresh(void);
113 nonvirtual void UpdateBoundingBoxes(void);
114 nonvirtual void LinkToEntity(string declClass);
115
116 vector m_vecStandingMins;
117 vector m_vecStandingMaxs;
118 vector m_vecCrouchMins;
119 vector m_vecCrouchMaxs;
120 vector m_vecProneMins;
121 vector m_vecProneMaxs;
122 vector m_vecNormalViewOffset;
123 vector m_vecCrouchViewOffset;
124 vector m_vecProneViewOffset;
125 string m_defLink;
126};
127
137
139void PMove_Init(void);
140
143 // end of pmove
This class is responsible for handling groups of key/value pairs.
Definition: NSDict.h:42
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
NSDict g_waterDamageDecl
Definition: pmove.h:134
waterlevel_t
Definition: pmove.h:34
void PMoveCustom_RunCrouchPhysics(entity)
Definition: pmove_custom.qc:716
NSDict g_lavaDamageDecl
Definition: pmove.h:136
NSDict g_waterDecl
Definition: pmove.h:130
void PMove_Init(void)
Called by Nuclide.
Definition: pmove.qc:655
NSDict g_slimeDecl
Definition: pmove.h:131
NSPMoveVars g_pmoveVars
The global, shared object containing all currently valid pmove parameters.
Definition: pmove.h:129
NSDict g_slimeDamageDecl
Definition: pmove.h:135
NSDict g_lavaDecl
Definition: pmove.h:132
NSDict g_fallDamageDecl
Definition: pmove.h:133
void PMoveCustom_RunPlayerPhysics(entity)
Definition: pmove_custom.qc:674
@ WATERLEVEL_KNEE
Definition: pmove.h:36
@ WATERLEVEL_SUBMERGED
Definition: pmove.h:38
@ WATERLEVEL_CHEST
Definition: pmove.h:37
@ WATERLEVEL_OUTSIDE
Definition: pmove.h:35
float maxspeed
Definition: sound.h:113