-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcamera.h
30 lines (29 loc) · 832 Bytes
/
camera.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include <vector>
#include "render.h"
#include "shape.h"
class Camera
{
public:
std::vector<Shape*> world;
void lookAt(std::vector<double> target);
void lookAt(double deg1, double deg2);
void moveTo(std::vector<double> coords);
void setResolution(double resolution);
void setRaySpeed(double speed);
std::vector<std::vector<Color>> getRender();
Camera(std::vector<double> coordinates);
void setAngle(double degrees);
private:
std::vector<double> coordinates{0,0,0};
std::vector<double> target{0,0,0};
std::vector<double> matrixBasisVector{};
std::vector<double> matrixStart{};
double viewRange = 100;
double viewAngle = 30;
double raySpeed = 1;
double resolution = 150;
double matrixWidth;
double pixelSize;
void calculateMatrix();
};