Assignments Assignments

Public Member Functions | Public Attributes | List of all members
Ray::Camera Class Reference

`#include <camera.h>`

## Public Member Functions
void | drawOpenGL (void) const
void | rotateUp (Util::Point3D center, float angle)
void | rotateRight (Util::Point3D center, float angle)
void | moveForward (float dist)
void | moveRight (float dist)
void | moveUp (float dist)
Util::Ray3D | getRay (int i, int j, int width, int height) const

## Public Attributes
double | heightAngle
Util::Point3D | position
Util::Point3D | forward
Util::Point3D | up
Util::Point3D | right

## Detailed Description

This class stores information about the camera.

## Member Function Documentation

## ◆ drawOpenGL()

void Camera::drawOpenGL | ( | void |  | ) | const

This method calls the OpenGL commands for setting up the camera.

## ◆ getRay()

Ray3D Camera::getRay | ( | int | i,
|  | int | j,
|  | int | width,
|  | int | height ) const

This function returns the ray that leaves the camera and goes through pixel (i,j) of the view plane

## ◆ moveForward()

void Camera::moveForward | ( | float | dist | ) |

This call moves the camera in the forward direction by the specified distance.

## ◆ moveRight()

void Camera::moveRight | ( | float | dist | ) |

This call moves the camera in the right direction by the specified distance.

## ◆ moveUp()

void Camera::moveUp | ( | float | dist | ) |

This call moves the camera in the up direction by the specified distance.

## ◆ rotateRight()

void Camera::rotateRight | ( | Util::Point3D | center,
|  | float | angle )

This call rotates the camera, about the axis which is parallel to the right direction of the camera, and passes through the specified point.

## ◆ rotateUp()

void Camera::rotateUp | ( | Util::Point3D | center,
|  | float | angle )

This call rotates the camera, about the axis which is parallel to the up direction of the camera, and passes through the specified point.

## Member Data Documentation

## ◆ forward

Util::Point3D Ray::Camera::forward

The direction that the camera is looking

## ◆ heightAngle

double Ray::Camera::heightAngle

The field of view of the camera (in radians)

## ◆ position

Util::Point3D Ray::Camera::position

The position of the camera in world coordinates

## ◆ right

Util::Point3D Ray::Camera::right

The right direction of the camera

## ◆ up

Util::Point3D Ray::Camera::up

The up direction of the camera

The documentation for this class was generated from the following files:

- Assignments/Ray/camera.h
- Assignments/Ray/camera.todo.cpp