{
entity player, raptor;
float ftmp, ftmp2;
- vector df, ra;
+ vector df;
if(intermission_running)
return 1;
}
}
- ra = raptor.angles;
- ra_z = 0;
// Aim the gunz
ftmp2 = autocvar_g_vehicle_raptor_cannon_turnspeed * frametime;
ftmp = -ftmp2;
df = gettaginfo(raptor.gun1, gettagindex(raptor.gun1, "fire1"));
ad = df;
vf = v_forward;
- //if(self.lock_strength == 1)
- //{
- df = vectoangles(normalize(trace_endpos - df)); // Find the direction & angle
- df = shortangle_vxy(df - (ra + raptor.gun1.angles), ra + raptor.gun1.angles); // Find aim offset
- //}
- //else
- // df = '0 0 0';
+ df = vectoangles(normalize(trace_endpos - df)); // Find the direction & angle
+ df = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(raptor.angles), AnglesTransform_FromAngles(df))) - raptor.gun1.angles;
+ df = shortangle_vxy(df, raptor.gun1.angles);
// Bind to aimspeed
df_x = bound(ftmp, df_x, ftmp2);
df = gettaginfo(raptor.gun2, gettagindex(raptor.gun2, "fire1"));
ad += df;
vf += v_forward;
- //if(self.lock_strength == 1)
- //{
- df = vectoangles(normalize(trace_endpos - df)); // Find the direction & angle
- df = shortangle_vxy(df - (ra + raptor.gun2.angles), ra + raptor.gun2.angles); // Find aim offset
- //}
- //else
- // df = '0 0 0';
-
+ df = vectoangles(normalize(trace_endpos - df)); // Find the direction & angle
+ df = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(raptor.angles), AnglesTransform_FromAngles(df))) - raptor.gun2.angles;
+ df = shortangle_vxy(df, raptor.gun2.angles);
+
// Bind to aimspeed
df_x = bound(ftmp, df_x, ftmp2);
df_y = bound(ftmp, df_y, ftmp2);
crosshair_trace(player);
//UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
- player.v_angle_x *= -1;
- gettaginfo(spider.tur_head, 0);
- ad = player.v_angle - vectoangles2(v_forward, v_up);
+ //player.v_angle_x *= -1;
+ //gettaginfo(spider.tur_head, 0);
+ //ad = player.v_angle - vectoangles2(v_forward, v_up);
//ad = player.v_angle - (spider.tur_head.angles + spider.angles);
- player.v_angle_x *= -1;
+ //player.v_angle_x *= -1;
+ ad = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(spider.angles), AnglesTransform_FromVAngles(player.v_angle))) - spider.tur_head.angles;
+
if(ad_x > 180) ad_x -= 360;
if(ad_x < -180) ad_x += 360;
if(ad_y > 180) ad_y -= 360;