How to get the surface type, and physical material with a projectile in C++?(No Linetraces)

I appreciate the advice I will make sure to try it out.