Nuclide
Software Development Kit for id Tech
NSRenderableEntity.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
17typedef enumflags
18{
19 RDENT_CHANGED_ORIGIN_X,
20 RDENT_CHANGED_ORIGIN_Y,
21 RDENT_CHANGED_ORIGIN_Z,
22 RDENT_CHANGED_ANGLES_X,
23 RDENT_CHANGED_ANGLES_Y,
24 RDENT_CHANGED_ANGLES_Z,
25 RDENT_CHANGED_MODELINDEX,
26 RDENT_CHANGED_SIZE,
27 RDENT_CHANGED_FLAGS,
28 RDENT_CHANGED_SOLIDMOVETYPE,
29 RDENT_CHANGED_FRAME,
30 RDENT_CHANGED_SKIN,
31 RDENT_CHANGED_EFFECTS,
32 RDENT_CHANGED_BODY,
33 RDENT_CHANGED_SCALE,
34 RDENT_CHANGED_VELOCITY,
35 RDENT_CHANGED_ANGULARVELOCITY,
36 RDENT_CHANGED_RENDERCOLOR,
37 RDENT_CHANGED_RENDERAMT,
38 RDENT_CHANGED_RENDERMODE,
39 RDENT_CHANGED_CONTROLLER
40} nsrenderableentity_changed_t;
41
42typedef enum
43{
51 RM_ADDFRAC = 7, /* Source 2004 */
52 RM_WORLDGLOW = 9, /* Source 2004 */
53 RM_DONTRENDER = 10, /* Source 2004 */
55
56typedef enum
57{
77 RFX_Q2PULSE = 21
79
80#ifdef CLIENT
83#endif
84
91{
92private:
93 /* new */
94 PREDICTED_FLOAT(m_flBoneControl1)
95 PREDICTED_FLOAT(m_flBoneControl2)
96 PREDICTED_FLOAT(m_flBoneControl3)
97 PREDICTED_FLOAT(m_flBoneControl4)
98 PREDICTED_FLOAT(m_flBoneControl5)
99 PREDICTED_FLOAT_N(modelflags)
100 PREDICTED_INT(m_iBody)
101 PREDICTED_FLOAT_N(colormap)
102 PREDICTED_VECTOR_N(glowmod)
104
105 PREDICTED_FLOAT(m_iRenderFX)
106 PREDICTED_FLOAT(m_iRenderMode)
107 PREDICTED_FLOAT(m_flRenderAmt)
108 PREDICTED_VECTOR(m_vecRenderColor)
109 PREDICTED_VECTOR(m_vecAxialScale)
110
111 /* either a sprite model or a particle */
112 PREDICTED_INT(m_iMuzzleModel)
113 PREDICTED_INT(m_iMuzzlePart)
114 PREDICTED_FLOAT(m_flMuzzleScale)
115
116 /* model events */
117 float m_flBaseTime;
118
119#ifdef CLIENT
120 float m_iNumBones;
121 nonvirtual void _UpdateGeomset();
122 nonvirtual void _UpdateBoneCount();
123#endif
124
125#ifdef SERVER
126 /* respawn */
127 float m_oldiRenderFX;
128 float m_oldiRenderMode;
129 float m_oldflRenderAmt;
130 vector m_oldvecRenderColor;
131#endif
132
133
134public:
135 void NSRenderableEntity(void);
136
137 /* overrides */
138 virtual void SpawnKey(string,string);
139#ifdef SERVER
140 virtual void Input(entity,string,string);
141 virtual void Respawn(void);
142 virtual void Save(float);
143 virtual void Restore(string,string);
144 virtual void EvaluateEntity(void);
145 virtual float SendEntity(entity,float);
146#endif
147
148#ifdef CLIENT
149 virtual void RenderDebugSkeleton(void);
150 virtual void ReceiveEntity(float,float);
151 virtual float predraw(void);
152 virtual void postdraw(void);
153 virtual void RendererRestarted();
154#endif
155
156 virtual void MakeStatic(void);
157
158 /* model events */
160 virtual void HandleAnimEvent(float,int,string);
161
162 /* set */
164 nonvirtual void SetBody(int);
166 nonvirtual void SetBodyInGroup(int, int);
168 nonvirtual void SetRenderFX(float);
170 nonvirtual void SetRenderMode(float);
172 nonvirtual void SetRenderAmt(float);
174 nonvirtual void SetRenderColor(vector);
176 nonvirtual void SetBoneControl1(float);
178 nonvirtual void SetBoneControl2(float);
180 nonvirtual void SetBoneControl3(float);
182 nonvirtual void SetBoneControl4(float);
184 nonvirtual void SetBoneControl5(float);
186 nonvirtual void SetAxialScale(vector);
187
188#ifdef SERVER
189 nonvirtual vector GetSpawnRenderColor(void);
190 nonvirtual float GetSpawnRenderAmt(void);
191 nonvirtual int GetSpawnRenderFX(void);
192 nonvirtual int GetSpawnRenderMode(void);
193#endif
194
196 nonvirtual int GetBody(void);
198 nonvirtual int GetBodyInGroup(int);
200 nonvirtual float GetRenderMode(void);
202 nonvirtual float GetRenderFX(void);
204 nonvirtual float GetRenderAmt(void);
206 nonvirtual vector GetRenderColor(void);
208 nonvirtual float GetBoneControl1(void);
210 nonvirtual float GetBoneControl2(void);
212 nonvirtual float GetBoneControl3(void);
214 nonvirtual float GetBoneControl4(void);
216 nonvirtual float GetBoneControl5(void);
218 nonvirtual vector GetAxialScale(void);
219
220 #ifdef CLIENT
222 nonvirtual void RenderFXPass(void);
223 nonvirtual void RenderAxialScale(void);
224 nonvirtual void RenderGLQuakeShadow(void);
225 #endif
226};
rendermode_t
Definition: NSRenderableEntity.h:43
@ RM_ADDITIVE
Definition: NSRenderableEntity.h:49
@ RM_ADDFRAC
Definition: NSRenderableEntity.h:51
@ RM_WORLDGLOW
Definition: NSRenderableEntity.h:52
@ RM_COLOR
Definition: NSRenderableEntity.h:45
@ RM_NORMAL
Definition: NSRenderableEntity.h:44
@ RM_FULLBRIGHT
Definition: NSRenderableEntity.h:50
@ RM_GLOW
Definition: NSRenderableEntity.h:47
@ RM_DONTRENDER
Definition: NSRenderableEntity.h:53
@ RM_TEXTURE
Definition: NSRenderableEntity.h:46
@ RM_SOLID
Definition: NSRenderableEntity.h:48
var int autocvar_rm_unlit_texture
Definition: NSRenderableEntity.h:82
renderfx_t
Definition: NSRenderableEntity.h:57
@ RFX_FASTWIDEPULSE
Definition: NSRenderableEntity.h:62
@ RFX_SLOWFLICKER
Definition: NSRenderableEntity.h:70
@ RFX_FASTPULSE
Definition: NSRenderableEntity.h:60
@ RFX_Q2PULSE
Definition: NSRenderableEntity.h:77
@ RFX_FASTSTROBE
Definition: NSRenderableEntity.h:68
@ RFX_SLOWBECOMESOLID
Definition: NSRenderableEntity.h:65
@ RFX_FASTBECOMESOLID
Definition: NSRenderableEntity.h:66
@ RFX_FASTERSTROBE
Definition: NSRenderableEntity.h:69
@ RFX_HOLOGRAM
Definition: NSRenderableEntity.h:74
@ RFX_SLOWPULSE
Definition: NSRenderableEntity.h:59
@ RFX_SLOWFADEAWAY
Definition: NSRenderableEntity.h:63
@ RFX_DISTORT
Definition: NSRenderableEntity.h:73
@ RFX_FASTFADEAWAY
Definition: NSRenderableEntity.h:64
@ RFX_NORMAL
Definition: NSRenderableEntity.h:58
@ RFX_CONSTANTGLOW
Definition: NSRenderableEntity.h:72
@ RFX_SLOWSTROBE
Definition: NSRenderableEntity.h:67
@ RFX_SLOWWIDEPULSE
Definition: NSRenderableEntity.h:61
@ RFX_GLOWSHELL
Definition: NSRenderableEntity.h:75
@ RFX_FASTFLICKER
Definition: NSRenderableEntity.h:71
@ RFX_GLOWSHELL2
Definition: NSRenderableEntity.h:76
var int autocvar_rm_unlit_additive
Definition: NSRenderableEntity.h:81
typedef enumflags
Definition: NSRenderableEntity.h:18
NSEntity is the lowest of the user-accessible entity class.
Definition: NSEntity.h:52
This entity represents any NSEntity with advanced rendering properties.
Definition: NSRenderableEntity.h:91
nonvirtual float GetRenderAmt(void)
Returns the render amount of the entity.
Definition: NSRenderableEntity.qc:901
nonvirtual float GetRenderMode(void)
Returns the render mode of the entity.
Definition: NSRenderableEntity.qc:889
nonvirtual void RenderFXPass(void)
Called by predraw(); and will set the appropriate rendering specific fields.
virtual void RendererRestarted()
Client: Called when video resources need to be allocated or reloaded for the entity.
Definition: NSRenderableEntity.qc:48
nonvirtual float GetSpawnRenderAmt(void)
Definition: NSRenderableEntity.qc:870
nonvirtual vector GetSpawnRenderColor(void)
Definition: NSRenderableEntity.qc:864
nonvirtual void SetBody(int)
Sets the bodygroup of the entity.
Definition: NSRenderableEntity.qc:768
nonvirtual float GetBoneControl4(void)
Returns the value of the entity's bone controller #4.
Definition: NSRenderableEntity.qc:931
nonvirtual void SetBoneControl1(float)
Sets the value of the bone controller #1.
Definition: NSRenderableEntity.qc:815
nonvirtual void SetAxialScale(vector)
Sets the axial, anisotropic scale of an entity, affecting the individual axis (forward,...
Definition: NSRenderableEntity.qc:845
nonvirtual float GetBoneControl1(void)
Returns the value of the entity's bone controller #1.
Definition: NSRenderableEntity.qc:913
nonvirtual int GetBodyInGroup(int)
Returns the body within a given group.
Definition: NSRenderableEntity.qc:857
nonvirtual void SetBoneControl5(float)
Sets the value of the bone controller #5.
Definition: NSRenderableEntity.qc:839
nonvirtual void SetRenderColor(vector)
Sets the render color of the entity.
Definition: NSRenderableEntity.qc:805
nonvirtual void SetBoneControl3(float)
Sets the value of the bone controller #3.
Definition: NSRenderableEntity.qc:827
nonvirtual void RenderGLQuakeShadow(void)
virtual void postdraw(void)
Client: Run after the rendering of 3D world is complete.
virtual float SendEntity(entity, float)
Called by the engine whenever we need to send a client an update about this entity.
Definition: NSRenderableEntity.qc:164
virtual void RenderDebugSkeleton(void)
virtual void HandleAnimEvent(float, int, string)
Callback for any model event that gets triggered while playing a framegroup.
Definition: NSRenderableEntity.qc:949
nonvirtual void SetRenderAmt(float)
Sets the render amount of the entity.
Definition: NSRenderableEntity.qc:799
nonvirtual float GetRenderFX(void)
Returns the render FX of the entity.
Definition: NSRenderableEntity.qc:895
nonvirtual int GetSpawnRenderFX(void)
Definition: NSRenderableEntity.qc:882
nonvirtual void SetBoneControl4(float)
Sets the value of the bone controller #4.
Definition: NSRenderableEntity.qc:833
nonvirtual void SetBoneControl2(float)
Sets the value of the bone controller #2.
Definition: NSRenderableEntity.qc:821
virtual void EvaluateEntity(void)
Run each tic after physics are run to determine if we need to send updates over the network.
Definition: NSRenderableEntity.qc:111
nonvirtual void SetBodyInGroup(int, int)
Sets the body inside of a specific group.
Definition: NSRenderableEntity.qc:778
nonvirtual float GetBoneControl5(void)
Returns the value of the entity's bone controller #5.
Definition: NSRenderableEntity.qc:937
nonvirtual void SetRenderFX(float)
Sets the render FX type of the entity.
Definition: NSRenderableEntity.qc:787
virtual void ReceiveEntity(float, float)
Client: Handles network updates from the server for the associated entity.
nonvirtual int GetBody(void)
Returns the bodygroup of the entity.
Definition: NSRenderableEntity.qc:851
virtual void Restore(string, string)
Similar to ::SpawnKey but for save-game fields.
Definition: NSRenderableEntity.qc:1049
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: NSRenderableEntity.qc:1143
virtual float predraw(void)
nonvirtual float GetBoneControl3(void)
Returns the value of the entity's bone controller #3.
Definition: NSRenderableEntity.qc:925
virtual void Input(entity, string, string)
Called when we are being prompted by another object/function with an input message.
Definition: NSRenderableEntity.qc:1103
nonvirtual vector GetRenderColor(void)
Returns the render color of the entity.
Definition: NSRenderableEntity.qc:907
nonvirtual int GetSpawnRenderMode(void)
Definition: NSRenderableEntity.qc:876
nonvirtual float GetBoneControl2(void)
Returns the value of the entity's bone controller #2.
Definition: NSRenderableEntity.qc:919
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: NSRenderableEntity.qc:1028
virtual void Respawn(void)
Server: Called when the entity first spawns or when game-logic requests the entity to return to its o...
Definition: NSRenderableEntity.qc:756
nonvirtual void RenderAxialScale(void)
nonvirtual vector GetAxialScale(void)
Returns the axial/anisotropic scale of the entity, same as input format (forward, right,...
Definition: NSRenderableEntity.qc:943
virtual void MakeStatic(void)
Tells the engine to make the entity static, effectively making it inaccessible.
Definition: NSRenderableEntity.qc:90
nonvirtual void SetRenderMode(float)
Sets the render mode type of the entity.
Definition: NSRenderableEntity.qc:793
void NSRenderableEntity(void)
Definition: NSRenderableEntity.qc:20
vector(vector) normalize
entity() spawn
const float TRUE
Definition: fteextensions.qc:862
#define PREDICTED_FLOAT_N(x)
Definition: defs.h:38
#define PREDICTED_FLOAT(x)
Definition: defs.h:31
#define PREDICTED_VECTOR_N(x)
Definition: defs.h:39
#define PREDICTED_VECTOR(x)
Definition: defs.h:32
#define PREDICTED_INT(x)
Definition: defs.h:30
noref float frame1time
Definition: ui_3dview.qc:22