Models a perspective camera.
More...
#include <PerspectiveCamera.h>
Models a perspective camera.
◆ PerspectiveCamera() [1/3]
| PerspectiveCamera::PerspectiveCamera |
( |
| ) |
|
Default constructor.
numberPixelsX and numberpixelsY are set to 500 by default.
◆ PerspectiveCamera() [2/3]
Main constructor.
- Parameters
-
| numberPixelsX | The width of the camera in pixels. It will define the width of the render. |
| numberPixelsY | The height of the camera in pixels. It will define the height of the render. |
| origin | From where the rays are casted. |
| focal | Its direction defines the camera's and its length defines the camera length. |
◆ PerspectiveCamera() [3/3]
Copy constructor.
- Parameters
-
| camera | The camera that will be copied. |
◆ getFocal()
Getter for the camera focal.
- Returns
- The camera focal.
◆ getNumberPixelsX()
| unsigned int PerspectiveCamera::getNumberPixelsX |
( |
| ) |
const |
Getter for the number of pixels in x.
- Returns
- The number of pixels that compose the camera on the x axis.
◆ getNumberPixelsY()
| unsigned int PerspectiveCamera::getNumberPixelsY |
( |
| ) |
const |
Getter for the number of pixels in y.
- Returns
- The number of pixels that compose the camera on the y axis.
◆ getOrigin()
Getter for the camera origin.
- Returns
- The camera origin.
◆ getRayGoingThrough()
| Ray PerspectiveCamera::getRayGoingThrough |
( |
double |
pixelX, |
|
|
double |
pixelY |
|
) |
| const |
Returns a ray going through some pixels.
See my TM's report for an explanation on how the computations work.
- Parameters
-
| pixelX | The x coordinate of the pixel through which we want the ray. |
| pixelY | The y coordinate of the pixel through which we want the ray. |
- Returns
- A ray which origin is the camera's and which direction is such that it goes through the requested pixel.
◆ getWorldHeight()
| double PerspectiveCamera::getWorldHeight |
( |
| ) |
const |
Getter for the camera world height.
- Returns
- The width of the camera in the virtual world.
◆ getWorldWidth()
| double PerspectiveCamera::getWorldWidth |
( |
| ) |
const |
Getter for the camera world width.
- Returns
- The width of the camera in the virtual world.
◆ setFocal()
Setter for the camera focal.
- Parameters
-
| focal | The new camera focal. |
◆ setNumberPixelsX()
| void PerspectiveCamera::setNumberPixelsX |
( |
unsigned int |
numberPixelsX | ) |
|
Setter for the number of pixels in x.
- Parameters
-
| numberPixelsX | The new number of pixels that compose the camera on the x axis. |
◆ setNumberPixelsY()
| void PerspectiveCamera::setNumberPixelsY |
( |
unsigned int |
numberPixelsY | ) |
|
Setter for the number of pixels in y.
- Parameters
-
| numberPixelsY | The new number of pixels that compose the camera on the y axis. |
◆ setOrigin()
| void PerspectiveCamera::setOrigin |
( |
DoubleVec3D |
origin | ) |
|
Setter for the camera origin.
- Parameters
-
| origin | The new camera origin. |
The documentation for this class was generated from the following files: