Nuclide
Software Development Kit for id Tech
NSView.h
Go to the documentation of this file.
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
35typedef enum
36{
42
48class
50{
51public:
52 void NSView(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(NSEntity);
84 nonvirtual void SetClientOwner(NSClient);
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(NSSoundScape);
122 nonvirtual NSSoundScape 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 NSEntity m_viewTarget;
138
139 NSClient m_client;
140
141 NSSoundScape 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: NSClient.h:26
NSEntity is the lowest of the user-accessible entity class.
Definition: NSEntity.h:54
Shared-Entity: Sound System Scape/Reverb Controller.
Definition: NSSoundScape.h:86
This class represents 3D views, used for rendering the game.
Definition: NSView.h:50
NSView g_viewSeats[4]
one NSView for each seat
Definition: NSView.h:153
viewmode_t
The view mode type of the NSView.
Definition: NSView.h:36
NSView g_view
the current seat run for each draw call, for each player.
Definition: NSView.h:156
@ VIEWMODE_FPS
uses view target position + view offset
Definition: NSView.h:38
@ VIEWMODE_NORMAL
just a regular camera with no special logic
Definition: NSView.h:37
@ VIEWMODE_SPECTATING
spectating, mixed viewmodes inside
Definition: NSView.h:40
@ VIEWMODE_THIRDPERSON
third person view, fixed
Definition: NSView.h:39