Added the ray tracing function to scene class.