hey thor, welcome to the wonderful world of design decisions
a common approach is to keep geometry in some kind of world/level object. that way, to query the location of a particular object, you can ask the world where it is. the world can then do a line trace, or employ some other technique to determine the object’s location at the mouse xy.
you might also look into the gluUnProject function. it takes points from screen-space back into world-space (handy info for line traces).
also, some clever use of gl picking can produce very good results. it all depends on what you’re after.