C++ raytracer implementation