how can i make pick up using line trace (use c++)?

have a problem. In topic its threme