player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
return 1;
}
+ crosshair_trace(player);
- vhic.angles_x *= -1;
- // Rotate Body
- ftmp = raptor_turnspeed * sys_frametime;
+#if VEHICLES_VIEWROTATE_CROSSHAIR
+ df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
+ if(df_x > 180) df_x -= 360;
- if(df_x < -180) df_x += 360;
++ if(df_x < -180) df_x += 360;--
+ if(df_y > 180) df_y -= 360;
+ if(df_y < -180) df_y += 360;
- ftmp = bound(-ftmp, shortangle_f(player.v_angle_y - vhic.angles_y, vhic.angles_y), ftmp);
-
- // Roll
- //ftmp = bound(-90,shortangle_f(player.v_angle_z + ((vhic.angles_y - ftmp2) * raptor_turnroll), vhic.angles_z),90);
- //ftmp = safeangle(vhic.angles_z + ftmp);
- //vhic.angles_z = ftmp;
+ // Rotate Body
+ ftmp = autocvar_g_vehicle_raptor_turnspeed * sys_frametime;
+ ftmp = bound(-ftmp, shortangle_f(df_y - raptor.angles_y, raptor.angles_y), ftmp);
// Turn
- vhic.angles_y = anglemods(vhic.angles_y + ftmp);
+ //raptor.angles_y = anglemods(raptor.angles_y + ftmp);
+ raptor.avelocity_y = anglemods(raptor.angles_y + ftmp);
// Pitch Body
- ftmp = raptor_pitchspeed * sys_frametime;
-
- ftmp = bound(-ftmp, shortangle_f(player.v_angle_x - vhic.angles_x,vhic.angles_x), ftmp);
+ ftmp = autocvar_g_vehicle_raptor_pitchspeed * sys_frametime;
+ ftmp = bound(-ftmp, shortangle_f(df_x - raptor.angles_x, raptor.angles_x), ftmp);
+
+ //raptor.angles_x = bound(-autocvar_g_vehicle_raptor_pitchlimit, anglemods(raptor.angles_x + ftmp), autocvar_g_vehicle_raptor_pitchlimit);
+ raptor.avelocity_x = bound(-autocvar_g_vehicle_raptor_pitchlimit, anglemods(raptor.angles_x + ftmp), autocvar_g_vehicle_raptor_pitchlimit);
+#else
+ vector vang;
+ vang = raptor.angles;
+ df = vectoangles(normalize(trace_endpos - self.origin + '0 0 32'));
+ vang_x *= -1;
+ df_x *= -1;
+ if(df_x > 180) df_x -= 360;
+ if(df_x < -180) df_x += 360;
+ if(df_y > 180) df_y -= 360;
+ if(df_y < -180) df_y += 360;
+
+ ftmp = shortangle_f(player.v_angle_y - vang_y, vang_y);
+ if(ftmp > 180) ftmp -= 360; if(ftmp < -180) ftmp += 360;
+ raptor.avelocity_y = bound(-autocvar_g_vehicle_raptor_turnspeed, ftmp + raptor.avelocity_y * 0.9, autocvar_g_vehicle_raptor_turnspeed);
+
+ // Pitch
+ ftmp = 0;
+ if(player.movement_x > 0 && vang_x < autocvar_g_vehicle_raptor_pitchlimit) ftmp = 5;
+ else if(player.movement_x < 0 && vang_x > -autocvar_g_vehicle_raptor_pitchlimit) ftmp = -20;
+
+ df_x = bound(-autocvar_g_vehicle_raptor_pitchlimit, df_x , autocvar_g_vehicle_raptor_pitchlimit);
+ ftmp = vang_x - bound(-autocvar_g_vehicle_raptor_pitchlimit, df_x + ftmp, autocvar_g_vehicle_raptor_pitchlimit);
+ raptor.avelocity_x = bound(-autocvar_g_vehicle_raptor_pitchspeed, ftmp + raptor.avelocity_x * 0.9, autocvar_g_vehicle_raptor_pitchspeed);
+
+ raptor.angles_x = anglemods(raptor.angles_x);
+ raptor.angles_y = anglemods(raptor.angles_y);
+ raptor.angles_z = anglemods(raptor.angles_z);
+
+#endif
+
+ if(autocvar_g_vehicle_raptor_movestyle == 1)
+ makevectors('0 1 0' * raptor.angles_y);
+ else
+ makevectors(player.v_angle);
- vhic.angles_x = bound(-60,anglemods(vhic.angles_x + ftmp),60);
- vhic.angles_x *= -1;
+#ifdef RAPTOR_RETARDCAMERA
+ float spd, back, up;
+ spd = vlen(self.velocity) + 0.01;
+ back = spd / autocvar_g_vehicle_raptor_speed_forward;
+ up = 1 - back;
+ back = back;
+ back = back * 1250;
+ back += 150;
+ up = up * 200;
+ up = up + 100;
- if(raptor_movestyle == 1)
- {
- ftmp = vhic.angles_z;
- vhic.angles_z = 0;
- ftmp2 = vhic.angles_x;
- vhic.angles_x = 0;
- fixedmakevectors(vhic.angles);
- vhic.angles_z = ftmp;
- vhic.angles_x = ftmp2;
- }
- else
- fixedmakevectors(vhic.angles);
+ setorigin(self.vehicle_viewport, self.origin + (v_up * up) + (v_forward * -back));
+#endif
- df = vhic.velocity * -1;
+ df = raptor.velocity * -autocvar_g_vehicle_raptor_friction;
if(player.movement_x != 0)
{