function rotate_model(rot_angle,rot_speed) {
if (my.pan == rot_angle) { return; }
temp.x = ang(rot_angle - my.pan);
if (temp.x > 0) { result = 1; }
if (temp.x < 0) { result = -1; }
my.pan_force = rot_speed * ang(rot_angle - my.pan);
my.pan_velocity += (time_step * my.pan_force) - (minv(time_step*0.7,1) * my.pan_velocity);
temp.x = ang(rot_angle.pan - (my.pan + my.pan_velocity));
if (temp.x > 0 && result == -1) || (temp.x < 0 && result == 1) { my.pan_velocity = ang(rot_angle.pan - my.pan); }
c_rotate(my,vector(my.pan_velocity * time_step,0,0),IGNORE_PASSABLE|IGNORE_YOU|IGNORE_MODELS|USE_BOX);
}