coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(coord3d));
- MAKE_VECTORS_NEW(pangles - '0 1 0' * teamradar_angle, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(pangles - '0 1 0' * teamradar_angle, forward, right, up);
if(v_flipped)
{
forward.x = -forward.x;
vel = view.velocity;
else
{
- MAKE_VECTORS_NEW(view_angles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(view_angles, forward, right, up);
vel.x = view.velocity * forward;
vel.y = view.velocity * right * -1;
vel.z = view.velocity * up;
if (autocvar_cl_followmodel_velocity_absolute)
{
vector fixed_gunorg;
- MAKE_VECTORS_NEW(view_angles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(view_angles, forward, right, up);
fixed_gunorg.x = gunorg * forward;
fixed_gunorg.y = gunorg * right * -1;
fixed_gunorg.z = gunorg * up;
vector pos = view_origin;
vector dir = view_forward;
- MAKE_VECTORS_NEW(autocvar_chase_active ? warpzone_save_view_angles : view_angles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(autocvar_chase_active ? warpzone_save_view_angles : view_angles, forward, right, up);
pos += right * -wepent.movedir.y
+ up * wepent.movedir.z;
curspeed = 0;
else
{
- MAKE_VECTORS_NEW(view_angles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(view_angles, forward, right, up);
v = pmove_vel;
if(csqcplayer)
v = csqcplayer.velocity;
else if(eventchase_current_distance != chase_distance)
eventchase_current_distance = chase_distance;
- MAKE_VECTORS_NEW(view_angles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(view_angles, forward, right, up);
vector eventchase_target_origin = (current_view_origin - (forward * eventchase_current_distance));
WarpZone_TraceBox(current_view_origin, autocvar_cl_eventchase_mins, autocvar_cl_eventchase_maxs, eventchase_target_origin, MOVE_WORLDONLY, this);
setproperty(VF_ORIGIN, '0 0 0');
setproperty(VF_ANGLES, '0 0 0');
setproperty(VF_PERSPECTIVE, 1);
- MAKE_VECTORS_NEW('0 0 0', forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS('0 0 0', forward, right, up);
vector v1, v2;
cvar_set("vid_conwidth", "800");
cvar_set("vid_conheight", "600");
if (this.m_screen_coords) {
screen_pos = this.origin + since_hit * autocvar_cl_damagetext_2d_velocity;
} else {
- MAKE_VECTORS_NEW(view_angles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(view_angles, forward, right, up);
vector world_offset = since_hit * autocvar_cl_damagetext_velocity_world + autocvar_cl_damagetext_offset_world;
vector world_pos = this.origin + world_offset.x * forward + world_offset.y * right + world_offset.z * up;
screen_pos = project_3d_to_2d(world_pos) + since_hit * autocvar_cl_damagetext_velocity_screen + autocvar_cl_damagetext_offset_screen;
if ((time - this.last_dodging_time) < PHYS_DODGING_DELAY)
return false;
- MAKE_VECTORS_NEW(this.angles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(this.angles, forward, right, up);
bool can_dodge = (is_close_to_ground(this, PHYS_DODGING_HEIGHT_THRESHOLD, up) && (PHYS_DODGING_MAXSPEED == 0 || vdist(this.velocity, <, PHYS_DODGING_MAXSPEED)));
bool can_wall_dodge = (PHYS_DODGING_WALL && is_close_to_wall(this, PHYS_DODGING_DISTANCE_THRESHOLD, forward, right));
return;
}
- vector forward = '0 0 0', right = '0 0 0', up = '0 0 0';
+ vector forward, right, up;
if(PHYS_DODGING_AIR)
MAKE_VECTORS(this.v_angle, forward, right, up);
else
// WEAPONTODO: trace to find what we actually hit
vector endpos = (this.sw_shotorg + (this.sw_shotdir * this.sw_distance));
- VECTOR_VECTORS_NEW(this.sw_shotdir, _forward, right, up);
+ vector _forward, right, up;
+ VECTOR_VECTORS(this.sw_shotdir, _forward, right, up);
// WEAPONTODO: combine and simplify these calculations
vector min_end = ((this.sw_shotorg + (this.sw_shotdir * SW_DISTTOMIN)) + (up * this.sw_spread_min));
// this mimics quakeworld code
if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc) {
vector yawangles = '0 1 0' * this.v_angle.y;
- MAKE_VECTORS_NEW(yawangles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(yawangles, forward, right, up);
vector spot = this.origin + 24 * forward;
spot_z += 8;
traceline(spot, spot, MOVE_NOMONSTERS, this);
}
}
- MAKE_VECTORS_NEW(vmul(this.v_angle, (this.com_phys_vel_2d ? '0 1 0' : '1 1 1')), forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(vmul(this.v_angle, (this.com_phys_vel_2d ? '0 1 0' : '1 1 1')), forward, right, up);
// wishvel = forward * PHYS_CS(this).movement.x + right * PHYS_CS(this).movement.y + up * PHYS_CS(this).movement.z;
vector wishvel = forward * PHYS_CS(this).movement.x
+ right * PHYS_CS(this).movement.y
if (this.iflags & IFLAG_ANGLES)
{
- FIXED_MAKE_VECTORS_NEW(this.angles, forward, right, up);
+ vector forward, right, up;
+ FIXED_MAKE_VECTORS(this.angles, forward, right, up);
if (f0 & IFLAG_VALID)
{
this.iforward1 = this.iforward2;
if (this.iflags & IFLAG_V_ANGLE)
{
- FIXED_MAKE_VECTORS_NEW(this.v_angle, forward, right, up);
+ vector forward, right, up;
+ FIXED_MAKE_VECTORS(this.v_angle, forward, right, up);
if (f0 & IFLAG_VALID)
{
this.ivforward1 = this.ivforward2;
CLEAR_V_GLOBALS(); \
MACRO_END
-/// Same as `MAKE_VECTORS` but also creates the locals for convenience.
-#define MAKE_VECTORS_NEW(angles, forward, right, up) \
- vector forward = '0 0 0', right = '0 0 0', up = '0 0 0'; \
- MAKE_VECTORS(angles, forward, right, up);
-
/// Returns all 4 vectors by assigning to them (instead of returning a value) for consistency (and sanity)
#define SKEL_GET_BONE_ABS(skel, bonenum, forward, right, up, origin) MACRO_BEGIN \
origin = _skel_get_boneabs_hidden(skel, bonenum) \
CLEAR_V_GLOBALS(); \
MACRO_END
-#define SKEL_GET_BONE_ABS_NEW(skel, bonenum, forward, right, up, origin) \
- vector forward = '0 0 0', right = '0 0 0', up = '0 0 0', origin = '0 0 0'; \
- SKEL_GET_BONE_ABS(skel, bonenum, forward, right, up, origin)
-
#define SKEL_SET_BONE(skel, bonenum, org, forward, right, up) MACRO_BEGIN \
SET_V_GLOBALS(forward, right, up); \
_skel_set_bone_hidden(skel, bonenum, org); \
CLEAR_V_GLOBALS(); \
MACRO_END
-#define VECTOR_VECTORS_NEW(forward_in, forward, right, up) \
- vector forward = '0 0 0', right = '0 0 0', up = '0 0 0'; \
- VECTOR_VECTORS(forward_in, forward, right, up);
-
/// Note that this only avoids the v_* globals, not the gettaginfo_* ones
#define GET_TAG_INFO(ent, tagindex, forward, right, up, origin) MACRO_BEGIN \
origin = _gettaginfo_hidden(ent, tagindex); \
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \
MACRO_END
-
-#define GET_TAG_INFO_NEW(ent, tagindex, forward, right, up, origin) \
- vector forward = '0 0 0', right = '0 0 0', up = '0 0 0', origin = '0 0 0'; \
- GET_TAG_INFO(ent, tagindex, forward, right, up, origin);
// angles in fixedmakevectors/fixedvectoangles space
vector AnglesTransform_Apply(vector transform, vector v)
{
- FIXED_MAKE_VECTORS_NEW(transform, forward, right, up);
+ vector forward, right, up;
+ FIXED_MAKE_VECTORS(transform, forward, right, up);
return forward * v.x + right * (-v.y) + up * v.z;
}
vector AnglesTransform_Multiply(vector t1, vector t2)
{
- FIXED_MAKE_VECTORS_NEW(t2, forward, right, up);
+ vector forward, right, up;
+ FIXED_MAKE_VECTORS(t2, forward, right, up);
forward = AnglesTransform_Apply(t1, forward);
up = AnglesTransform_Apply(t1, up);
return fixedvectoangles2(forward, up);
vector AnglesTransform_Invert(vector transform)
{
vector i_forward, i_up;
- FIXED_MAKE_VECTORS_NEW(transform, forward, right, up);
+ vector forward, right, up;
+ FIXED_MAKE_VECTORS(transform, forward, right, up);
// we want angles that turn forward into '1 0 0', right into '0 1 0' and up into '0 0 1'
// but these are orthogonal unit vectors!
// so to invert, we can simply fixedvectoangles the TRANSPOSED matrix
#if POSITIVE_PITCH_IS_DOWN
#define fixedmakevectors makevectors
#define FIXED_MAKE_VECTORS MAKE_VECTORS
- #define FIXED_MAKE_VECTORS_NEW MAKE_VECTORS_NEW
noref vector _fixedvectoangles;
#define fixedvectoangles(a) (_fixedvectoangles = vectoangles(a), _fixedvectoangles.x *= -1, _fixedvectoangles)
noref vector _fixedvectoangles2;
GET_V_GLOBALS(forward, right, up); \
CLEAR_V_GLOBALS(); \
MACRO_END
- #define FIXED_MAKE_VECTORS_NEW(angles, forward, right, up) \
- VECS_NEW(forward, right, up); \
- FIXED_MAKE_VECTORS(angles, forward, right, up);
#define fixedvectoangles2 vectoangles2
#define fixedvectoangles vectoangles
#endif
e.warpzone_targetorigin = other_org;
e.warpzone_angles = my_ang;
e.warpzone_targetangles = other_ang;
- FIXED_MAKE_VECTORS_NEW(my_ang, forward, right, up);
+ vector forward, right, up;
+ FIXED_MAKE_VECTORS(my_ang, forward, right, up);
e.warpzone_forward = forward;
FIXED_MAKE_VECTORS(other_ang, forward, right, up);
e.warpzone_targetforward = forward;
if(area > 0)
{
org = org - ((org - point) * norm) * norm; // project to plane
- MAKE_VECTORS_NEW(ang, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(ang, forward, right, up);
if(norm * forward < 0)
{
LOG_INFO("Position target of trigger_warpzone near ", vtos(this.aiment.origin), " points into trigger_warpzone. BEWARE.");
if (this.movedir == '0 0 0')
if (this.angles != '0 0 0')
{
- MAKE_VECTORS_NEW(this.angles, forward, _r, _u);
+ vector forward, _r, _u;
+ MAKE_VECTORS(this.angles, forward, _r, _u);
this.movedir = forward;
}
if(this.model == "")
if (autocvar_r_showbboxes)
{
// show where spawnpoints point at too
- MAKE_VECTORS_NEW(this.angles, forward, right, up);
+ vector forward, right, up;
+ MAKE_VECTORS(this.angles, forward, right, up);
entity e = new(info_player_foo);
setorigin(e, this.origin + forward * 24);
setsize(e, '-8 -8 -8', '8 8 8');
WarpZone_TraceLine(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * range, MOVE_NOMONSTERS, ent);
ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
- vector forward = '0 0 0', right = '0 0 0', up = '0 0 0';
+ vector forward, right, up;
forward = v_forward;
right = v_right;
up = v_up;
return;
}
- MAKE_VECTORS_NEW(actor.v_angle, fo, ri, up);
+ vector fo, ri, up;
+ MAKE_VECTORS(actor.v_angle, fo, ri, up);
// Change weapon
if (this.m_weapon != this.m_switchweapon)