A simple pathtracer program, capable of producing renderings of simple bodies. The program computes global illumination, by intersecting scene objects, such as luminaries and solid bodies, with idealised surface properies.
#ifndef RAYTRACER_CAMERA_HPP
#define RAYTRACER_CAMERA_HPP
#include "./vec3.hpp"
namespace raytracer
{
class camera
{
public:
camera(const vec3& pos, const vec3& upVect, const vec3& lookAt);
virtual ~camera(){}
inline vec3 const & pos() { return pos_; }
inline vec3 const & dir() { return dir_; }
inline vec3 const & right() { return right_; }
inline vec3 const & down() { return down_; }
inline vec3 const & up_vect() { return up_vect_; }
inline void look_at(const vec3& lookat) { recalc(&pos_, &lookat); }
inline void pos(const vec3& pos) { recalc(&pos, NULL); }
inline void up_vect(const vec3& upVect) { this->up_vect_= upVect; recalc(&pos_, NULL); }
private:
void recalc(const vec3* pos, const vec3* lookAt);
vec3 right_, down_, pos_, dir_, up_vect_;
};
}
#endif