I have been making a 3D game from scratch using opengl and C++ and I want to know how I can make a ray casting class in C++ for my game where I can call it when ever I need to, to check for things like hitting something, shooting at something, distance from something, etc.
If anyone could help that would be great!