crt/camera.hpp
#pragma once
#include "vertex.hpp"
#include "common.hpp"
class Camera {
private:
ray_t ray;
const coord_t depth;
vertex_t raster_center, raster_x, raster_y;
void update_raster();
public:
const unsigned raster_w, raster_h;
Camera(const vertex_t& origin, const vertex_t& direction, unsigned w, unsigned h);
void get_ray(unsigned x, unsigned y, ray_t& r, vertex_t& n) const;
void get_move(const vertex_t&, ray_t&) const;
void move(const vertex_t&, const vertex_t&);
};