2001-04-11 16:19:08 +00:00
|
|
|
/*
|
2021-03-12 02:48:53 +00:00
|
|
|
view.h
|
2001-04-11 16:19:08 +00:00
|
|
|
|
|
|
|
(description)
|
|
|
|
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
// view.h
|
|
|
|
|
2022-02-28 03:12:51 +00:00
|
|
|
#ifndef __client_view_h
|
|
|
|
#define __client_view_h
|
2001-04-11 16:19:08 +00:00
|
|
|
|
|
|
|
#include "QF/mathlib.h"
|
2021-03-11 07:19:49 +00:00
|
|
|
#include "QF/simd/types.h"
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
#include "QF/scene/entity.h"
|
2001-04-11 16:19:08 +00:00
|
|
|
|
2022-03-29 05:45:49 +00:00
|
|
|
typedef struct {
|
|
|
|
int destcolor[3];
|
|
|
|
int percent; // 0-255
|
|
|
|
double time;
|
|
|
|
int initialpct;
|
|
|
|
} cshift_t;
|
|
|
|
|
|
|
|
#define CSHIFT_CONTENTS 0
|
|
|
|
#define CSHIFT_DAMAGE 1
|
|
|
|
#define CSHIFT_BONUS 2
|
|
|
|
#define CSHIFT_POWERUP 3
|
|
|
|
#define NUM_CSHIFTS 4
|
|
|
|
|
2001-04-11 16:19:08 +00:00
|
|
|
#define INFO_CSHIFT_BONUS (1 << 0)
|
|
|
|
#define INFO_CSHIFT_CONTENTS (1 << 1)
|
|
|
|
#define INFO_CSHIFT_DAMAGE (1 << 2)
|
|
|
|
#define INFO_CSHIFT_POWERUP (1 << 3)
|
|
|
|
|
2021-03-19 11:18:45 +00:00
|
|
|
typedef struct viewstate_s {
|
2022-03-01 02:43:23 +00:00
|
|
|
vec4f_t player_origin;
|
|
|
|
vec3_t player_angles;
|
|
|
|
int chase;
|
2021-03-19 11:18:45 +00:00
|
|
|
vec4f_t movecmd;
|
|
|
|
vec4f_t velocity;
|
2022-02-25 06:48:57 +00:00
|
|
|
vec4f_t punchangle;
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
transform_t camera_transform;
|
2022-02-25 06:48:57 +00:00
|
|
|
double time;
|
2022-12-01 08:50:13 +00:00
|
|
|
double realtime;
|
2022-11-02 06:08:09 +00:00
|
|
|
double last_servermessage;
|
2022-11-02 00:52:35 +00:00
|
|
|
float frametime;
|
2022-02-25 06:48:57 +00:00
|
|
|
float height;
|
2021-03-19 11:18:45 +00:00
|
|
|
int weaponframe;
|
2021-03-19 15:58:37 +00:00
|
|
|
int onground; // -1 when in air
|
2022-11-03 08:49:05 +00:00
|
|
|
unsigned active:1;
|
|
|
|
unsigned loading:1;
|
|
|
|
unsigned watervis:1;
|
|
|
|
unsigned demoplayback:1;
|
|
|
|
unsigned drift_enabled:1;
|
|
|
|
unsigned voffs_enabled:1;
|
|
|
|
unsigned bob_enabled:1;
|
|
|
|
unsigned intermission:1;
|
|
|
|
unsigned decay_punchangle:1;
|
2022-02-25 06:48:57 +00:00
|
|
|
int force_cshifts; // bitfield of server enforced cshifts
|
2021-03-19 11:18:45 +00:00
|
|
|
uint32_t flags;
|
2022-02-25 06:48:57 +00:00
|
|
|
|
|
|
|
int powerup_index;
|
|
|
|
cshift_t cshifts[NUM_CSHIFTS]; // Color shifts for damage, powerups
|
|
|
|
cshift_t prev_cshifts[NUM_CSHIFTS]; // and content types
|
2022-02-28 07:55:12 +00:00
|
|
|
quat_t cshift_color;
|
2022-02-25 06:48:57 +00:00
|
|
|
|
|
|
|
// pitch drifting vars
|
|
|
|
float idealpitch;
|
|
|
|
float pitchvel;
|
|
|
|
qboolean nodrift;
|
|
|
|
float driftmove;
|
|
|
|
double laststop;
|
|
|
|
|
|
|
|
struct model_s *weapon_model;
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
entity_t weapon_entity;
|
|
|
|
entity_t player_entity;
|
2022-02-25 06:48:57 +00:00
|
|
|
|
|
|
|
struct chasestate_s *chasestate;
|
2021-03-19 11:18:45 +00:00
|
|
|
} viewstate_t;
|
|
|
|
|
|
|
|
#define VF_DEAD 1
|
|
|
|
#define VF_GIB 2
|
|
|
|
|
2022-02-28 03:12:51 +00:00
|
|
|
struct msg_s;
|
|
|
|
|
|
|
|
void V_Init (viewstate_t *vs);
|
2001-04-11 16:19:08 +00:00
|
|
|
void V_Init_Cvars (void);
|
2022-02-25 06:48:57 +00:00
|
|
|
void V_RenderView (viewstate_t *vs);
|
2021-03-11 07:19:49 +00:00
|
|
|
float V_CalcRoll (const vec3_t angles, vec4f_t velocity);
|
2022-02-25 06:48:57 +00:00
|
|
|
void V_StartPitchDrift (viewstate_t *vs);
|
|
|
|
void V_StopPitchDrift (viewstate_t *vs);
|
|
|
|
void V_SetContentsColor (viewstate_t *vs, int contents);
|
2022-02-28 03:12:51 +00:00
|
|
|
void V_ParseDamage (struct msg_s *net_message, viewstate_t *vs);
|
|
|
|
void V_PrepBlend (viewstate_t *vs);
|
|
|
|
|
|
|
|
extern qboolean noclip_anglehack;
|
2001-04-11 16:19:08 +00:00
|
|
|
|
2022-02-28 03:12:51 +00:00
|
|
|
#endif // __client_view_h
|