18 int xResolution,
int yResolution)
19 : focalLength(focalLength),
20 xCenter(xCenter), yCenter(yCenter),
21 xResolution(xResolution), yResolution(yResolution) {};
26 xResolution, yResolution) {};
52 int xResolution;
int yResolution;
A full description of a camera. Enough information to reconstruct the camera matrix and then some.
Vec2 SpatialToCamera(const Vec3 &) const
Converts from a 3D point in space to a 2D point on the camera sensor.
Camera(const Camera &)=default
void SetFocalLength(decimal focalLength)
bool InSensor(const Vec2 &vector) const
Returns whether a given pixel is actually in the camera's field of view.
Camera(decimal focalLength, decimal xCenter, decimal yCenter, int xResolution, int yResolution)
int XResolution() const
Width of the sensor in pixels.
int YResolution() const
Height of the sensor in pixels.
decimal Fov() const
Horizontal field of view in radians.
Vec3 CameraToSpatial(const Vec2 &) const
Gives a point in 3d space that could correspond to the given vector, using the same coordinate system...
Camera(decimal focalLength, int xResolution, int yResolution)
decimal FocalLength() const
Focal length in pixels.
Three dimensional vector with decimaling point components.
decimal FovToFocalLength(decimal xFov, decimal xResolution)
A two dimensional vector with decimaling point components.