Nuclide
Software Development Kit for id Technology (BETA)
Loading...
Searching...
No Matches
View.h
1/*
2 * Copyright (c) 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
28
33
42
48class
50{
51public:
52 void ncView(void);
53
55 virtual void SetupView(void);
57 virtual void RenderView(void);
58
60 virtual void StairSmooth(void);
61
63 virtual void UpdateView(void);
64
66 nonvirtual void AddPunchAngle(vector);
67
68 /* set/get */
70 nonvirtual void SetViewMode(viewmode_t);
72 nonvirtual viewmode_t GetViewMode(void);
73
75 nonvirtual void SetViewPosition(vector);
77 nonvirtual void SetViewSize(vector);
79 nonvirtual void SetViewTarget(ncEntity);
84 nonvirtual void SetClientOwner(ncClient);
85
87 nonvirtual void SetDrawLocalPlayer(bool);
88
90 nonvirtual void SetCameraOrigin(vector);
92 nonvirtual void SetCameraAngle(vector);
94 nonvirtual void SetClientAngle(vector);
96 nonvirtual void SetSeatID(int);
98 nonvirtual void SetAFOV(float);
100 nonvirtual float GetAFOV(void);
102 nonvirtual void SetSensitivity(float);
104 nonvirtual float GetSensitivity(void);
105
107 nonvirtual vector GetHUDCanvasSize(void);
109 nonvirtual vector GetHUDCanvasPos(void);
110
112 nonvirtual float GetViewWidth(void);
114 nonvirtual float GetViewHeight(void);
115
117 nonvirtual vector GetCameraOrigin(void);
119 nonvirtual vector GetCameraAngle(void);
120
121 nonvirtual void SetSoundScape(ncSoundScape);
122 nonvirtual ncSoundScape GetSoundScape(void);
123
124private:
125 int m_iSeat;
126
127 /* the dimensions of our view */
128 vector m_vecPosition;
129 vector m_vecSize;
130 float m_flFieldOfView;
131 viewmode_t m_viewmode;
132 float m_flSensitivity;
133
134 vector m_vecLastOrigin;
135
136 /* the entity we're targetting */
137 ncEntity m_viewTarget;
138
139 ncClient m_client;
140
141 ncSoundScape m_soundScape;
142
143 vector m_vecClientAngle;
144 bool m_bSetClientAngle;
145
146 bool m_bDrawLocalPlayer;
147 bool m_bDrawEntities;
148
149 bool _m_bWasAlive;
150};
151
154
157 // end of client
This entity class is the lowest client/player class.
Definition Client.h:34
ncEntity is the lowest of the user-accessible entity class.
Definition Entity.h:75
Shared-Entity: Sound System Scape/Reverb Controller.
Definition SoundScape.h:67
This class represents 3D views, used for rendering the game.
Definition View.h:50
nonvirtual void SetViewMode(viewmode_t)
Sets the viewmode_t of the ncView.
Definition View.qc:199
nonvirtual vector GetHUDCanvasSize(void)
Returns the canvas size of the heads up display.
Definition View.qc:257
nonvirtual void SetViewTarget(ncEntity)
Sets the view target of the ncView.
Definition View.qc:162
nonvirtual ncSoundScape GetSoundScape(void)
Definition View.qc:291
nonvirtual viewmode_t GetViewMode(void)
Gets the viewmode_t of the ncView.
Definition View.qc:205
nonvirtual void SetViewSize(vector)
Sets the canvas of the ncView.
Definition View.qc:156
nonvirtual float GetAFOV(void)
Returns the absolute field of view of the ncView.
Definition View.qc:229
nonvirtual void SetViewPosition(vector)
Sets the position of the ncView on the screen.
Definition View.qc:150
nonvirtual void SetClientOwner(ncClient)
Sets the client owner of the ncView.
Definition View.qc:217
nonvirtual void AddPunchAngle(vector)
applies an punch to our camera angle, temporarily
Definition View.qc:279
nonvirtual float GetViewHeight(void)
Get the absolute height of the view, in pixels.
Definition View.qc:273
virtual void RenderView(void)
only does one thing: renderscene()
Definition View.qc:106
nonvirtual vector GetCameraOrigin(void)
Returns the 3D world coordinate of the ncView.
Definition View.qc:180
nonvirtual float GetSensitivity(void)
Returns the sensitivity of the ncView.
Definition View.qc:241
nonvirtual void SetAFOV(float)
Sets the absolute field of view of the ncView.
Definition View.qc:223
nonvirtual vector GetHUDCanvasPos(void)
Returns the canvas size of a heads-up-display.
Definition View.qc:247
nonvirtual void SetClientAngle(vector)
Sets the client-angle of the ncView.
Definition View.qc:192
nonvirtual void SetSensitivity(float)
Sets the sensitivity multiplier of the ncView.
Definition View.qc:235
nonvirtual void SetSoundScape(ncSoundScape)
Definition View.qc:285
virtual void UpdateView(void)
called every CSQC_UpdateView for each player
Definition View.qc:301
void ncView(void)
Definition View.qc:23
virtual void StairSmooth(void)
when called, will modify 'origin' to vertically smoothed when on ground
Definition View.qc:118
nonvirtual void SetSeatID(int)
Sets the seat id of the ncView.
Definition View.qc:211
nonvirtual void SetCameraOrigin(vector)
Sets the 3D position of the ncView.
Definition View.qc:168
nonvirtual void SetCameraAngle(vector)
Sets the 3D direction of the ncView.
Definition View.qc:174
nonvirtual float GetViewWidth(void)
Get the absolute width of the view, in pixels.
Definition View.qc:267
nonvirtual void SetDrawLocalPlayer(bool)
Call with the argument true and you will draw the body of the view target.
Definition View.qc:112
virtual void SetupView(void)
the only method we we want to call setproperty()
Definition View.qc:49
nonvirtual vector GetCameraAngle(void)
Returns the 3D direction of the ncView.
Definition View.qc:186
viewmode_t
The view mode type of the ncView.
Definition View.h:36
ncView g_view
the current seat run for each draw call, for each player.
Definition View.h:156
ncView g_viewSeats[4]
one ncView for each seat
Definition View.h:153
@ VIEWMODE_FPS
uses view target position + view offset
Definition View.h:38
@ VIEWMODE_NORMAL
just a regular camera with no special logic
Definition View.h:37
@ VIEWMODE_SPECTATING
spectating, mixed viewmodes inside
Definition View.h:40
@ VIEWMODE_THIRDPERSON
third person view, fixed
Definition View.h:39