17 if(this.
viewloc.goalentity ==
this.viewloc.enemy)
20 vector old_movement = PHYS_CS(
this).movement;
21 PHYS_CS(
this).movement_x = old_movement_y;
23 PHYS_CS(
this).movement_y = old_movement_x;
25 PHYS_CS(
this).movement_y = 0;
27 vector level_start, level_end;
28 level_start = this.
viewloc.enemy.origin;
29 level_end = this.
viewloc.goalentity.origin;
34 PHYS_CS(
this).movement_y = -PHYS_CS(
this).movement_y;
39 PHYS_CS(
this).movement_x = -PHYS_CS(
this).movement_x;
43 if(PHYS_CS(
this).movement_x < 0)
44 PHYS_CS(
this).movement_x = -PHYS_CS(
this).movement_x;
46 if(PHYS_CS(
this).movement_x < 0)
47 this.angles_y = backward.y;
48 if(PHYS_CS(
this).movement_x > 0)
49 this.angles_y = forward.y;
57 if (old_movement.x < 0)
60 if (old_movement.x < 0)
63 this.
flags |= FL_DUCKED;
74 void viewloc_SetTags(
entity this)
79 if(this.
viewloc.entnum !=
this.tag_networkviewloc)
81 if(this.tag_networkviewloc == 0)
91 vector wfar = cs_unproject(
vec3(mpos.x, mpos.y, max_shot_distance));
96 vector old_camera_angle =
'0 0 0';
97 void viewloc_SetViewLocation()
101 entity viewloc_ent = view.viewloc;
102 if(viewloc_ent && !wasfreed(viewloc_ent) && viewloc_ent.enemy && viewloc_ent.goalentity)
104 bool have_sidescroll = (viewloc_ent.enemy != viewloc_ent.goalentity);
105 vector position_a = viewloc_ent.enemy.origin;
106 vector position_b = viewloc_ent.goalentity.origin;
107 vector camera_angle =
'0 0 0';
112 camera_position =
vec_bounds_in(view.origin, position_a, position_b);
116 camera_angle = viewloc_ent.enemy.movedir;
121 camera_angle =
aim_vec (camera_position, view.origin);
132 camera_angle =
aim_vec(camera_position, view.origin);
138 float camera_angle_diff =
max(camera_angle.y, old_camera_angle.y) -
min(camera_angle.y, old_camera_angle.y);
140 if (60 <= camera_angle_diff) {
143 camera_angle.y = old_camera_angle.y;
167 if (have_sidescroll) {
168 vector view_angle = view.angles;
173 avatar_facing_dir = view_angle;
179 view_angle.y = avatar_facing_dir.y;
191 mpos.x = view.origin.x;
192 view_angle =
aim_vec(view.origin + view.view_ofs, mpos);
194 view.angles_y = view_angle.y;
const int VIEWLOC_CAM_TRACK
#define PHYS_INPUT_BUTTON_CROUCH(s)
entity CSQCModel_server2csqc(int i)
const float VF_CL_VIEWANGLES
const int VIEWLOC_FREEAIM
ERASEABLE vector aim_vec(vector org, vector targ)
const int VIEWLOC_CAM_SNAP_CLOSE
void viewloc_PlayerPhysics(entity this)
ERASEABLE vector vec_to_max(vector a, vector b)
const int VIEWLOC_CAM_NOANGLE
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
const float MOVE_NOMONSTERS
ERASEABLE vector vec_to_min(vector a, vector b)
#define STATIC_INIT_LATE(func)
directly after STATIC_INIT
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int VIEWLOC_CAM_SNAP_UNLOCK
ERASEABLE vector angle_snap_vec(vector v, float increment)
const int VIEWLOC_FREEMOVE
int autocvar_vid_conwidth
ERASEABLE float angle_snap_f(float f, float increment)
const int VIEWLOC_CAM_SNAP_HARD
int autocvar_vid_conheight
ERASEABLE vector vec_bounds_in(vector point, vector a, vector b)