Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvsg::Camera Class Reference

Base class for all camera types. More...

#include <Camera.h>

Inheritance diagram for nvsg::Camera:

Inheritance graph
[legend]
Collaboration diagram for nvsg::Camera:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual NVSG_API const Camera * clone (void) const=0
 Interface for creating a clone of this camera. More...

virtual NVSG_API void addHeadLight (const LightSource *pLight, const nvmath::Vec3f &trans=nvmath::Vec3f(0.0f, 0.0f, 0.0f), const nvmath::Quatf &quat=nvmath::Quatf(0.0f, 0.0f, 0.0f, 1.0f))=0
 Interface for adding a headlight to this camera. More...

virtual NVSG_API bool removeHeadLight (size_t index=0)=0
 Interface for removing a headlight. More...

virtual NVSG_API size_t getNumberOfHeadLights () const=0
 Interface for getting the number of headlights attached to the camera. More...

virtual NVSG_API const LightSourcegetHeadLight (size_t index) const=0
 Interface for getting a headlight of this camera. More...

virtual NVSG_API void getHeadLightTrafo (nvmath::Vec3f &trans, nvmath::Quatf &quat, size_t index=0) const=0
 Interface for getting the position/orientation of a camera's headlight. More...

virtual NVSG_API bool setHeadLightTrafo (const nvmath::Vec3f &trans, const nvmath::Quatf &quat, size_t index=0)=0
 Interface for setting the headlight position and orientation relative to the camera. More...

virtual NVSG_API float getTargetDistance () const=0
 Interface for getting the distance to the target point. More...

virtual NVSG_API void setTargetDistance (float td)=0
 Interface for setting the distance to the target point. More...

virtual NVSG_API const nvmath::Vec3fgetPosition () const=0
 Interface for getting the camera position. More...

virtual NVSG_API void setPosition (const nvmath::Vec3f &pos)=0
 Interface for setting the camera position. More...

virtual NVSG_API void setUpVector (const nvmath::Vec3f &up)=0
 Interface for setting the up direction. More...

virtual NVSG_API nvmath::Vec3f getUpVector () const=0
 Interface for getting the up direction. More...

virtual NVSG_API nvmath::Vec3f getDirection () const=0
 Interface for getting the viewing direction. More...

virtual NVSG_API void setDirection (const nvmath::Vec3f &dir)=0
 Interface for setting the viewing direction. More...

virtual NVSG_API void setOrientation (const nvmath::Quatf &quat)=0
 Interface for setting the orientation of the camera. More...

virtual NVSG_API void setOrientation (const nvmath::Vec3f &dir, const nvmath::Vec3f &up)=0
 Interface for setting the orientation of the camera. More...

virtual NVSG_API void setOrientation (const nvmath::Vec3f &axis, float angle)=0
 Interface for setting the orientation of the camera. More...

virtual NVSG_API nvmath::Quatf getOrientation (void) const=0
 Get the current orientation. More...

virtual NVSG_API nvmath::Mat44f getWorldToViewMatrix () const=0
 Interface for getting the world-to-view transformation. More...

virtual NVSG_API nvmath::Mat44f getViewToWorldMatrix () const=0
 Interface for getting the inverse world to view transformation. More...

virtual NVSG_API const nvmath::Vec2fgetWindowOffset (void) const=0
 Interface for getting the window offset. More...

virtual NVSG_API void setWindowOffset (const nvmath::Vec2f &offset)=0
 Interface for setting the window offset. More...

virtual NVSG_API void getWindowRegion (nvmath::Vec2f &lowerLeft, nvmath::Vec2f &upperRight) const=0
 Interface for getting the relative window region to view. More...

virtual NVSG_API void setWindowRegion (const nvmath::Vec2f &lowerLeft, const nvmath::Vec2f &upperRight)=0
 Interface for setting the relative window region to view. More...

virtual NVSG_API const nvmath::Vec2fgetWindowSize () const=0
 Interface for getting the window size. More...

virtual NVSG_API void setWindowSize (const nvmath::Vec2f &size)=0
 Interface for setting the window size. More...

virtual NVSG_API float getAspectRatio () const=0
 Interface for getting the current aspect ratio. More...

virtual NVSG_API void setAspectRatio (float ar, bool keepWidth=false)=0
 Interface for setting the aspect ratio. More...

virtual NVSG_API bool isAutoClipPlanes () const=0
 Interface for determining if auto clipping is on. More...

virtual NVSG_API void setAutoClipPlanes (bool on)=0
 Interface for enabling/disabling automatic clip plane determination. More...

virtual NVSG_API void calcNearFarDistances (const nvmath::Sphere3f &sphere)=0
 Interface for calculating the near and far clipping distances. More...

virtual NVSG_API float getFarDistance () const=0
 Interface for getting the far clipping distance. More...

virtual NVSG_API void setFarDistance (float fd)=0
 Interface for setting the far clipping distance. More...

virtual NVSG_API float getNearDistance () const=0
 Interface for getting the near clipping distance. More...

virtual NVSG_API void setNearDistance (float nd)=0
 Interface for setting the near clipping distance. More...

virtual NVSG_API void move (const nvmath::Vec3f &delta)=0
 Interface for moving the camera. More...

virtual NVSG_API void orbit (const nvmath::Vec3f &axis, float rad)=0
 Interface for orbiting the camera. More...

virtual NVSG_API void rotate (const nvmath::Vec3f &axis, float rad, bool cameraRelative=true)=0
 Interface for rotating the camera. More...

virtual NVSG_API void zoom (float factor)=0
 Interface for zooming by a certain factor. More...

virtual NVSG_API void zoom (const nvmath::Sphere3f &sphere, float fovy=-1.0f)=0
 Interface for zooming to fit view to a sphere. More...

void moveX (float val)
 Move the camera to the right/left (camera coordinates). More...

void moveY (float val)
 Move the camera up/down (camera coordinates). More...

void moveZ (float val)
 Move the camera back/forth (camera coordinates). More...

void orbitX (float rad)
 Orbit the camera around the camera's x-axis. More...

void orbitY (float rad)
 Orbit the camera around the up direction. More...

void orbitZ (float rad)
 Orbit the camera around the negative view direction. More...

void rotateX (float rad, bool cameraRelative=true)
 Rotate the camera around the camera's x-axis. More...

void rotateY (float rad, bool cameraRelative=true)
 Rotate the camera around the up direction. More...

void rotateZ (float rad, bool cameraRelative=true)
 Rotate the camera around the negative view direction. More...


Protected Methods

NVSG_API Camera ()
 Protected constructor. More...

virtual NVSG_API ~Camera (void)
 Protected destructor to prevent explicit creation on stack. More...


Detailed Description

Base class for all camera types.


Constructor & Destructor Documentation

nvsg::Camera::Camera   [inline, protected]
 

Protected constructor.

nvsg::Camera::~Camera void    [inline, protected, virtual]
 

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

virtual NVSG_API const Camera* nvsg::Camera::clone void    const [pure virtual]
 

Interface for creating a clone of this camera.

Returns:
A constant pointer to the new Camera object.

Implemented in nvsg::JitterCamera, nvsg::MonoCamera, nvsg::ParallelCamera, nvsg::PerspectiveCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::addHeadLight const LightSource   pLight,
const nvmath::Vec3f   trans = nvmath::Vec3f(0.0f, 0.0f, 0.0f),
const nvmath::Quatf   quat = nvmath::Quatf(0.0f, 0.0f, 0.0f, 1.0f)
[pure virtual]
 

Interface for adding a headlight to this camera.

Parameters:
pLight  Pointer to the LightSource to add.
trans  Specifies the translation relative to camera.
quat  Specifies the rotation relative to camera.

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API bool nvsg::Camera::removeHeadLight size_t    index = 0 [pure virtual]
 

Interface for removing a headlight.

Returns:
true if the headlight was removed, otherwise false
Parameters:
index  index of head light to remove

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API size_t nvsg::Camera::getNumberOfHeadLights   const [pure virtual]
 

Interface for getting the number of headlights attached to the camera.

Returns:
Number of headlights attached to this camera.

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API const LightSource* nvsg::Camera::getHeadLight size_t    index const [pure virtual]
 

Interface for getting a headlight of this camera.

Returns:
A constant pointer to the headlight at index index, or a null pointer if there is no headlight available at index index.
Parameters:
index  Index of headlight to get

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::getHeadLightTrafo nvmath::Vec3f   trans,
nvmath::Quatf   quat,
size_t    index = 0
const [pure virtual]
 

Interface for getting the position/orientation of a camera's headlight.

Parameters:
trans  The translation relative to the camera will be received here.
quat  The rotation relative to the camera will be received here.
index  Index of the headlight to get transform information from.

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API bool nvsg::Camera::setHeadLightTrafo const nvmath::Vec3f   trans,
const nvmath::Quatf   quat,
size_t    index = 0
[pure virtual]
 

Interface for setting the headlight position and orientation relative to the camera.

Returns:
true if a headlight with this index exists, false otherwise.
Parameters:
trans  position of headlight - default is (0,0,0)
quat  orientation of headlight - default is (0,0,0,1)
index  index of headlight

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API float nvsg::Camera::getTargetDistance   const [pure virtual]
 

Interface for getting the distance to the target point.

Returns:
distance to the target point

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setTargetDistance float    td [pure virtual]
 

Interface for setting the distance to the target point.

Parameters:
td  distance to target point (or viewing plane)

Implemented in nvsg::JitterCamera, nvsg::PerspectiveCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API const nvmath::Vec3f& nvsg::Camera::getPosition   const [pure virtual]
 

Interface for getting the camera position.

Returns:
position of camera

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setPosition const nvmath::Vec3f   pos [pure virtual]
 

Interface for setting the camera position.

Parameters:
pos  new camera position

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setUpVector const nvmath::Vec3f   up [pure virtual]
 

Interface for setting the up direction.

Parameters:
up  up direction (might change viewing direction)

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API nvmath::Vec3f nvsg::Camera::getUpVector   const [pure virtual]
 

Interface for getting the up direction.

Returns:
up direction of camera

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API nvmath::Vec3f nvsg::Camera::getDirection   const [pure virtual]
 

Interface for getting the viewing direction.

Returns:
viewing direction

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setDirection const nvmath::Vec3f   dir [pure virtual]
 

Interface for setting the viewing direction.

Parameters:
dir  new viewing direction (might change upVector)

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setOrientation const nvmath::Quatf   quat [pure virtual]
 

Interface for setting the orientation of the camera.

Parameters:
quat  quaternion that determines direction and up vector

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setOrientation const nvmath::Vec3f   dir,
const nvmath::Vec3f   up
[pure virtual]
 

Interface for setting the orientation of the camera.

Parameters:
dir  direction to look at
up  up vector

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setOrientation const nvmath::Vec3f   axis,
float    angle
[pure virtual]
 

Interface for setting the orientation of the camera.

Parameters:
axis  axis to rotate about
angle  angle to rotate

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API nvmath::Quatf nvsg::Camera::getOrientation void    const [pure virtual]
 

Get the current orientation.

Returns:
quaternion that describes the orientation

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API nvmath::Mat44f nvsg::Camera::getWorldToViewMatrix   const [pure virtual]
 

Interface for getting the world-to-view transformation.

Returns:
world-to-camera transformation

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API nvmath::Mat44f nvsg::Camera::getViewToWorldMatrix   const [pure virtual]
 

Interface for getting the inverse world to view transformation.

Returns:
inverse of the world to camera transformation (i.e. camera to world)

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API const nvmath::Vec2f& nvsg::Camera::getWindowOffset void    const [pure virtual]
 

Interface for getting the window offset.

Returns:
window offset

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setWindowOffset const nvmath::Vec2f   offset [pure virtual]
 

Interface for setting the window offset.

Parameters:
offset  window ofset to viewing reference point

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::getWindowRegion nvmath::Vec2f   lowerLeft,
nvmath::Vec2f   upperRight
const [pure virtual]
 

Interface for getting the relative window region to view.

Parameters:
lowerLeft  relative lower left position
upperRight  relative upper right position

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setWindowRegion const nvmath::Vec2f   lowerLeft,
const nvmath::Vec2f   upperRight
[pure virtual]
 

Interface for setting the relative window region to view.

Parameters:
lowerLeft  relative lower left position
upperRight  relative upper right position

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API const nvmath::Vec2f& nvsg::Camera::getWindowSize   const [pure virtual]
 

Interface for getting the window size.

Returns:
window size

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setWindowSize const nvmath::Vec2f   size [pure virtual]
 

Interface for setting the window size.

Parameters:
size  window size (world coordinates)

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API float nvsg::Camera::getAspectRatio   const [pure virtual]
 

Interface for getting the current aspect ratio.

Returns:
width versus height of the camera window

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setAspectRatio float    ar,
bool    keepWidth = false
[pure virtual]
 

Interface for setting the aspect ratio.

Parameters:
ar  new aspect ratio
keepWidth  keep width or height constant

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API bool nvsg::Camera::isAutoClipPlanes   const [pure virtual]
 

Interface for determining if auto clipping is on.

If auto clipping is on, the camera determines the optimal near and front clipping distances from the scene. If the user has additional information about the scene that might help clipping, it should be turned off.

Returns:
true if auto clip is on, otherwise false

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setAutoClipPlanes bool    on [pure virtual]
 

Interface for enabling/disabling automatic clip plane determination.

Parameters:
on  true to enable, false to disable

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::calcNearFarDistances const nvmath::Sphere3f   sphere [pure virtual]
 

Interface for calculating the near and far clipping distances.

Parameters:
sphere  bounding sphere of the world to look at

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API float nvsg::Camera::getFarDistance   const [pure virtual]
 

Interface for getting the far clipping distance.

Returns:
distance to the far clipping plane

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setFarDistance float    fd [pure virtual]
 

Interface for setting the far clipping distance.

Parameters:
fd  far clipping distance

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API float nvsg::Camera::getNearDistance   const [pure virtual]
 

Interface for getting the near clipping distance.

Returns:
distance to the near clipping plane

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::setNearDistance float    nd [pure virtual]
 

Interface for setting the near clipping distance.

Parameters:
nd  near clipping distance

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::move const nvmath::Vec3f   delta [pure virtual]
 

Interface for moving the camera.

Parameters:
delta  delta to move the camera (camera coordinates)

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::orbit const nvmath::Vec3f   axis,
float    rad
[pure virtual]
 

Interface for orbiting the camera.

Parameters:
axis  axis to orbit around (camera coordinates)
rad  angle to orbit (radians)

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::rotate const nvmath::Vec3f   axis,
float    rad,
bool    cameraRelative = true
[pure virtual]
 

Interface for rotating the camera.

Parameters:
axis  axis to rotate around
rad  angle to rotate (radians)
cameraRelative  flag to indicate if the axis is camera or world relative

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::zoom float    factor [pure virtual]
 

Interface for zooming by a certain factor.

Parameters:
factor  zoom in/out by this factor; changes windowSize

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

virtual NVSG_API void nvsg::Camera::zoom const nvmath::Sphere3f   sphere,
float    fovy = -1.0f
[pure virtual]
 

Interface for zooming to fit view to a sphere.

Parameters:
sphere  sphere to zoom on
fovy  field of view; if negative, keep the current field of view

Implemented in nvsg::JitterCamera, nvsg::SimpleCamera, and nvsg::StereoCamera.

void nvsg::Camera::moveX float    val [inline]
 

Move the camera to the right/left (camera coordinates).

Parameters:
val  coordinate delta to move

void nvsg::Camera::moveY float    val [inline]
 

Move the camera up/down (camera coordinates).

Parameters:
val  coordinate delta to move

void nvsg::Camera::moveZ float    val [inline]
 

Move the camera back/forth (camera coordinates).

Parameters:
val  coordinate delta to move

void nvsg::Camera::orbitX float    rad [inline]
 

Orbit the camera around the camera's x-axis.

Parameters:
rad  angle to orbit (radians)

void nvsg::Camera::orbitY float    rad [inline]
 

Orbit the camera around the up direction.

Parameters:
rad  angle to orbit (radians)

void nvsg::Camera::orbitZ float    rad [inline]
 

Orbit the camera around the negative view direction.

Parameters:
rad  angle to orbit (radians)

void nvsg::Camera::rotateX float    rad,
bool    cameraRelative = true
[inline]
 

Rotate the camera around the camera's x-axis.

Parameters:
rad  angle to rotate (radians)
cameraRelative  flag to indicate if the axis is camera or world relative

void nvsg::Camera::rotateY float    rad,
bool    cameraRelative = true
[inline]
 

Rotate the camera around the up direction.

Parameters:
rad  angle to rotate (radians)
cameraRelative  flag to indicate if the axis is camera or world relative

void nvsg::Camera::rotateZ float    rad,
bool    cameraRelative = true
[inline]
 

Rotate the camera around the negative view direction.

Parameters:
rad  angle to rotate (radians)
cameraRelative  flag to indicate if the axis is camera or world relative


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:24 2005 for NVSGSDK by NVIDIA