Update the call signature of compute_primary_ray
It takes the current X and Y coordinates and the height and width of the image.
This commit is contained in:
parent
05327fbe7a
commit
0e1106aa41
2 changed files with 8 additions and 4 deletions
|
@ -120,8 +120,10 @@ Camera::SetUp(const Vector3& up)
|
||||||
* the view into the scene.
|
* the view into the scene.
|
||||||
*/
|
*/
|
||||||
Ray
|
Ray
|
||||||
OrthographicCamera::compute_primary_ray(const int &x,
|
OrthographicCamera::compute_primary_ray(const int x,
|
||||||
const int &y)
|
const int width,
|
||||||
|
const int y,
|
||||||
|
const int height)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
// Calculate the point on the image plane that the given (x,y) coordinate pair corresponds to.
|
// Calculate the point on the image plane that the given (x,y) coordinate pair corresponds to.
|
||||||
|
|
|
@ -28,12 +28,13 @@ public:
|
||||||
void set_direction(const Vector3 &d);
|
void set_direction(const Vector3 &d);
|
||||||
float get_angle() const;
|
float get_angle() const;
|
||||||
|
|
||||||
virtual Ray compute_primary_ray(const int &x, const int &y) const = 0;
|
|
||||||
const Vector3& GetRight() const;
|
const Vector3& GetRight() const;
|
||||||
void SetRight(const Vector3& right);
|
void SetRight(const Vector3& right);
|
||||||
const Vector3& GetUp() const;
|
const Vector3& GetUp() const;
|
||||||
void SetUp(const Vector3& up);
|
void SetUp(const Vector3& up);
|
||||||
|
|
||||||
|
virtual Ray compute_primary_ray(const int x, const int width,
|
||||||
|
const int y, const int height) const = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Size of the image plane.
|
// Size of the image plane.
|
||||||
|
@ -51,7 +52,8 @@ class OrthographicCamera
|
||||||
: public Camera
|
: public Camera
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Ray compute_primary_ray(const int &x, const int &y) const;
|
Ray compute_primary_ray(const int x, const int width,
|
||||||
|
const int y, const int height) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue