Stores camera location and view focus, used to view scene objects. More...
Public Member Functions | |
Camera (const Point &=Point(0, 0, 5), const Point &=Point(0, 0, 0), const Vector &=Vector(0, 1, 0), float=45.f, float=0.1f, float=100.f, CameraMode=Lookat) | |
~Camera () | |
void | reset () |
void | moveCam (const Vector &) |
void | rotateCam (const Vector &, float) |
void | setLookMode (CameraMode) |
void | setFOV (float fov_) |
void | setNear (float near_) |
void | setFar (float far_) |
Point | getEye () const |
Point | getLook () const |
Point | getRotPt () const |
Vector | getUp () const |
float | getFOV () const |
float | getNear () const |
float | getFar () const |
CameraMode | getMode () const |
Private Attributes | |
float | fov |
float | near |
float | far |
CameraMode | mode |
Chooses whether to rotate about the camera or the lookat point. | |
Vector | move |
Initial Camera Settings | |
Hangs on to the original camera specifications. | |
Point | initPos |
Point | initLook |
Vector | initUp |
float | initFOV |
Rotation Information | |
Stores rotation information. | |
Point | origin |
Quaternion | rotation |
Static Private Attributes | |
static const Vector | refUp = Vector(0.f, 1.f, 0.f) |
static const Vector | refIn = Vector(0.f, 0.f, -1.f) |
static const Vector | refSide = Vector(1.f, 0.f, 0.f) |
Stores camera location and view focus, used to view scene objects.
uiCore::Camera::Camera | ( | const Point & | position_ = Point(0, 0, 5) , |
const Point & | look_ = Point(0, 0, 0) , |
||
const Vector & | up_ = Vector(0, 1, 0) , |
||
float | fov_ = 45.f , |
||
float | near_ = 0.1f , |
||
float | far_ = 100.f , |
||
CameraMode | mode_ = Lookat |
||
) |
References reset().
uiCore::Camera::~Camera | ( | ) | [inline] |
Point uiCore::Camera::getEye | ( | ) | const [inline] |
References uiCore::Eye, mode, move, origin, Math::Quaternion::rotateV(), and rotation.
Referenced by rtVTK::rlRenderer::camSetup(), rtVTK::rlRenderer::drawRay(), rtVTK::rlRenderer::envSetup(), uiCore::Trackball::getEye(), rtVTK::glRenderer::render(), setLookMode(), and rtVTK::MainWindow::slotUpdateCoords().
float uiCore::Camera::getFar | ( | ) | const [inline] |
References far.
Referenced by rtVTK::rlRenderer::camSetup(), uiCore::Trackball::getFar(), and rtVTK::glRenderer::render().
float uiCore::Camera::getFOV | ( | ) | const [inline] |
References fov.
Referenced by rtVTK::rlRenderer::camSetup(), uiCore::Trackball::getFOV(), rtVTK::glRenderer::render(), and rtVTK::MainWindow::slotUpdateCoords().
Point uiCore::Camera::getLook | ( | ) | const [inline] |
References uiCore::Lookat, mode, move, origin, refIn, Math::Quaternion::rotateV(), and rotation.
Referenced by rtVTK::rlRenderer::camSetup(), uiCore::Trackball::getLook(), rtVTK::glRenderer::render(), setLookMode(), and rtVTK::MainWindow::slotUpdateCoords().
CameraMode uiCore::Camera::getMode | ( | ) | const [inline] |
References mode.
Referenced by uiCore::Trackball::getMode().
float uiCore::Camera::getNear | ( | ) | const [inline] |
References near.
Referenced by rtVTK::rlRenderer::camSetup(), uiCore::Trackball::getNear(), and rtVTK::glRenderer::render().
Point uiCore::Camera::getRotPt | ( | ) | const [inline] |
References uiCore::Lookat, mode, move, origin, Math::Quaternion::rotateV(), and rotation.
Referenced by rtVTK::glRenderer::render().
Vector uiCore::Camera::getUp | ( | ) | const [inline] |
References refUp, Math::Quaternion::rotateV(), and rotation.
Referenced by rtVTK::rlRenderer::camSetup(), uiCore::Trackball::getUp(), and rtVTK::glRenderer::render().
void uiCore::Camera::moveCam | ( | const Vector & | dir | ) |
The origin is translated. This function is always called when middle button is pressed. Technically this should not be named "moveCam" because technically the camera moves when rotations occur. Dolly will also adjust the focal point because the focal point is always a set distance away from the camera, similar to a parabolic mirror.
References origin, Math::Quaternion::rotateV(), and rotation.
Referenced by uiCore::Trackball::mouseMove().
void uiCore::Camera::reset | ( | ) |
References Math::Quaternion::encodeR(), fov, initFOV, initLook, initPos, initUp, Math::Quaternion::inverse(), uiCore::Lookat, mode, move, origin, refIn, refSide, Math::Quaternion::rotateV(), and rotation.
Referenced by Camera(), and uiCore::Trackball::reset().
void uiCore::Camera::rotateCam | ( | const Vector & | axis, |
float | angle | ||
) |
References Math::Quaternion::encodeR(), Math::Quaternion::rotateV(), and rotation.
Referenced by uiCore::Trackball::mouseMove().
void uiCore::Camera::setFar | ( | float | far_ | ) | [inline] |
References far.
void uiCore::Camera::setFOV | ( | float | fov_ | ) | [inline] |
References fov.
Referenced by uiCore::Trackball::setFOV().
void uiCore::Camera::setLookMode | ( | CameraMode | mode_ | ) |
References getEye(), getLook(), Math::Quaternion::inverse(), uiCore::Lookat, mode, move, origin, Math::Quaternion::rotateV(), and rotation.
Referenced by uiCore::Trackball::setLookMode().
void uiCore::Camera::setNear | ( | float | near_ | ) | [inline] |
References near.
float uiCore::Camera::far [private] |
float uiCore::Camera::fov [private] |
float uiCore::Camera::initFOV [private] |
Referenced by reset().
Point uiCore::Camera::initLook [private] |
Referenced by reset().
Point uiCore::Camera::initPos [private] |
Referenced by reset().
Vector uiCore::Camera::initUp [private] |
Referenced by reset().
CameraMode uiCore::Camera::mode [private] |
Chooses whether to rotate about the camera or the lookat point.
Referenced by getEye(), getLook(), getMode(), getRotPt(), reset(), and setLookMode().
Vector uiCore::Camera::move [private] |
Referenced by getEye(), getLook(), getRotPt(), reset(), and setLookMode().
float uiCore::Camera::near [private] |
Point uiCore::Camera::origin [private] |
Referenced by getEye(), getLook(), getRotPt(), moveCam(), reset(), and setLookMode().
const Vector uiCore::Camera::refIn = Vector(0.f, 0.f, -1.f) [static, private] |
const Vector uiCore::Camera::refSide = Vector(1.f, 0.f, 0.f) [static, private] |
Referenced by reset().
const Vector uiCore::Camera::refUp = Vector(0.f, 1.f, 0.f) [static, private] |
Referenced by getUp().
Quaternion uiCore::Camera::rotation [private] |
Referenced by getEye(), getLook(), getRotPt(), getUp(), moveCam(), reset(), rotateCam(), and setLookMode().