// get mouse position on terrain surface
void Camera_Mouse3D1()
{
VECTOR pos1, pos2;
vec_set( pos1 , vector(mouse_pos.x,mouse_pos.y,0) );
vec_for_screen (pos1, camera);
vec_set( pos2 , vector(mouse_pos.x,mouse_pos.y,15000) ); // should be a big value
vec_for_screen (pos2, camera);
c_trace (pos1.x, pos2.x, IGNORE_ME | IGNORE_CONTENT | IGNORE_SPRITES | IGNORE_PASSABLE | IGNORE_MODELS | IGNORE_MAPS | IGNORE_FLAG2);
// if there is a HIT_TARGET event, now "target" and "hit.x" hold the coordinates of the hit point
// ignoring tile sprites, models, map-entities and other passable entities including passable terrains (water)
}