function set_target()
{
var pos1;
var pos2;
pos1.x = mouse_pos.x;
pos1.y = mouse_pos.y;
pos1.z = 0;
vec_for_screen (pos1, camera);
pos2.x = mouse_pos.x;
pos2.y = mouse_pos.y;
pos2.z = 1000; // use a big value here
vec_for_screen (pos2, camera);
trace (pos1, pos2); // now "target" holds the coordinates of the hit point
draw_point3d(target,vector(0,0,255),100,50);
}
function rotate_to_mouse()
{
vec_set(temp,vector(mouse_pos.x,mouse_pos.y,5000));
vec_for_screen(temp,camera);//world cood
c_trace(camera.x,temp,ignore_passable);
vec_set(temp,target.x);
vec_sub(temp,fisch.x);
vec_to_angle(temp,temp);//now points from me to mousepos
fisch.pan = temp.x;
}