cloudy-raytracer/camera/perspectivecamera.h

30 lines
792 B
C
Raw Normal View History

2022-11-05 22:08:16 +01:00
#ifndef PERSPECTIVECAMERA_H
#define PERSPECTIVECAMERA_H
#include "camera/camera.h"
class PerspectiveCamera : public Camera {
public:
// Constructor / Destructor
PerspectiveCamera();
~PerspectiveCamera() override = default;
// Set
void setPosition(Vector3d const &position) { this->position = position; }
void setForwardDirection(Vector3d const &forwardDirection) { this->forwardDirection = normalized(forwardDirection); }
void setUpDirection(Vector3d const &upDirection) { this->upDirection = normalized(upDirection); }
void setFovAngle(float fovAngle) { this->fovAngle = fovAngle; }
// Camera functions
Ray createRay(float x, float y) const override;
protected:
Vector3d position;
Vector3d forwardDirection;
Vector3d upDirection;
float fovAngle;
};
#endif