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

nvsg::StereoCamera Class Reference

A stereoscopic camera. More...

#include <StereoCamera.h>

Inheritance diagram for nvsg::StereoCamera:

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

Collaboration graph
[legend]
List of all members.

Public Methods

virtual NVSG_API const StereoCamera * clone (void) const
 Create a clone of this StereoCamera. More...

virtual NVSG_API bool isDataShared (void) const
 Determine whether the data of this object is shared. More...

virtual NVSG_API DataID getDataID (void) const
 Get the DataID of the data of this object. More...

NVSG_API float getDepthFactor (void) const
 Get the depth factor. More...

NVSG_API void setDepthFactor (float df)
 Set the depth factor. More...

NVSG_API float getFocusDistance (void) const
 Get the focal distance. More...

NVSG_API void setFocusDistance (float fd)
 Set the focus distance. More...

NVSG_API bool isLeftPassIndex (size_t pass) const
 Ask if pass is the left pass. More...

NVSG_API void reverseLeftRight (void)
 Reverse left and right pass order. More...

NVSG_API void updateMonoCameras (void) const
 Update the monoscopic cameras (right and left). More...

const MonoCameragetMonoCamera (void) const
 Get the base camera. More...

const MonoCameragetLeftCamera () const
 Get the camera for the left eye. More...

const MonoCameragetRightCamera () const
 Get the camera for the right eye. More...

virtual NVSG_API void addHeadLight (const LightSource *pLight, const nvmath::Vec3f &position=nvmath::Vec3f(0.0f, 0.0f, 0.0f), const nvmath::Quatf &quat=nvmath::Quatf(0.0f, 0.0f, 0.0f, 1.0f))
 Add a head light on this camera. More...

virtual NVSG_API size_t getNumberOfHeadLights (void) const
 Get number of headlights attached to the camera. More...

virtual NVSG_API const LightSourcegetHeadLight (size_t index) const
 Get the indexed head light of this camera. More...

virtual NVSG_API bool removeHeadLight (size_t index=0)
 Remove a headlight. More...

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

virtual NVSG_API void getHeadLightTrafo (nvmath::Vec3f &trans, nvmath::Quatf &quat, size_t index=0) const
 Get the position/orientation of the indexed head light of this camera. More...

virtual NVSG_API float getTargetDistance (void) const
 Get the distance to the target point. More...

virtual NVSG_API void setTargetDistance (float td)
 Set the distance to the target point. More...

virtual NVSG_API nvmath::Vec3f getUpVector (void) const
 Get the up direction. More...

virtual NVSG_API const nvmath::Vec3fgetPosition (void) const
 Get the camera position. More...

virtual NVSG_API void setPosition (const nvmath::Vec3f &pos)
 Set the camera position. More...

virtual NVSG_API void setUpVector (const nvmath::Vec3f &up)
 Set the up direction. More...

virtual NVSG_API nvmath::Vec3f getDirection (void) const
 Get viewing direction. More...

virtual NVSG_API void setDirection (const nvmath::Vec3f &dir)
 Set the viewing direction. More...

virtual NVSG_API void setOrientation (const nvmath::Quatf &quat)
 Set the orientation of the camera. More...

virtual NVSG_API void setOrientation (const nvmath::Vec3f &dir, const nvmath::Vec3f &up)
 Set the orientation of the camera. More...

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

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

virtual NVSG_API nvmath::Mat44f getViewToWorldMatrix (void) const
 Get the inverse of the camera specific world-to-view transformation. More...

virtual NVSG_API nvmath::Mat44f getWorldToViewMatrix (void) const
 Get the world to view transformation. More...

virtual NVSG_API const nvmath::Vec2fgetWindowOffset (void) const
 Get the window offset. More...

virtual NVSG_API void setWindowOffset (const nvmath::Vec2f &offset)
 Set the window offset. More...

virtual NVSG_API void getWindowRegion (nvmath::Vec2f &lowerLeft, nvmath::Vec2f &upperRight) const
 Get the relative window region to view. More...

virtual NVSG_API void setWindowRegion (const nvmath::Vec2f &lowerLeft, const nvmath::Vec2f &upperRight)
 Set the relative window region to view. More...

virtual NVSG_API const nvmath::Vec2fgetWindowSize (void) const
 Get the window size. More...

virtual NVSG_API void setWindowSize (const nvmath::Vec2f &size)
 Set the window size. More...

virtual NVSG_API float getAspectRatio (void) const
 Get the current aspect ratio. More...

virtual NVSG_API void setAspectRatio (float ar, bool keepWidth=false)
 Set the aspect ratio. More...

virtual NVSG_API void setAutoClipPlanes (bool on)
 Enable/Disable automatic clip plane determination. More...

virtual NVSG_API bool isAutoClipPlanes (void) const
 Get auto clipping state. More...

virtual NVSG_API float getFarDistance (void) const
 Get distance to the far clipping plane. More...

virtual NVSG_API void setFarDistance (float fd)
 Set the far clipping distance. More...

virtual NVSG_API float getNearDistance (void) const
 Get distance to the near clipping plane. More...

virtual NVSG_API void setNearDistance (float nd)
 Set the near clipping distance. More...

virtual NVSG_API void calcNearFarDistances (const nvmath::Sphere3f &sphere)
 Calculate the distances to the near and far clipping planes. More...

virtual NVSG_API void move (const nvmath::Vec3f &delta)
 Move the camera. More...

virtual NVSG_API void orbit (const nvmath::Vec3f &axis, float rad)
 Orbit the camera. More...

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

virtual NVSG_API void zoom (float factor)
 Zoom by a factor. More...

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


Static Public Methods

NVSG_API const StereoCamera * create (const MonoCamera &base)
 Create a StereoCamera using a MonoCamera as a base. More...

NVSG_API const StereoCamera * createFromBase (const Camera &rhs, const MonoCamera &base)
 Create a StereoCamera by copying from an other. More...


Protected Methods

NVSG_API StereoCamera (const MonoCamera &base)
 Constructor. More...

NVSG_API StereoCamera (const Camera &rhs, const MonoCamera &base)
 Partial Constructor. More...

NVSG_API StereoCamera (const StereoCamera &rhs)
 Copy constructor. More...

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


Detailed Description

A stereoscopic camera.

With this camera stereoscopic vision is introduced.


Constructor & Destructor Documentation

NVSG_API nvsg::StereoCamera::StereoCamera const MonoCamera   base [protected]
 

Constructor.

A StereoCamera uses an arbitrary MonoCamera as its base camera. This base camera is used and slightly adjusted to get stereo vision.

Parameters:
base  base camera to use

NVSG_API nvsg::StereoCamera::StereoCamera const Camera   rhs,
const MonoCamera   base
[protected]
 

Partial Constructor.

NVSG_API nvsg::StereoCamera::StereoCamera const StereoCamera &    rhs [protected]
 

Copy constructor.

virtual NVSG_API nvsg::StereoCamera::~StereoCamera void    [protected, virtual]
 

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

NVSG_API const StereoCamera* nvsg::StereoCamera::create const MonoCamera   base [static]
 

Create a StereoCamera using a MonoCamera as a base.

Returns:
a constant pointer to a StereoCamera.
Parameters:
base  base of the StereoCamera

NVSG_API const StereoCamera* nvsg::StereoCamera::createFromBase const Camera   rhs,
const MonoCamera   base
[static]
 

Create a StereoCamera by copying from an other.

Parameters:
rhs  Camera to copy from
base  base of the StereoCamera

virtual NVSG_API const StereoCamera* nvsg::StereoCamera::clone void    const [virtual]
 

Create a clone of this StereoCamera.

Returns:
pointer to the new PerspectiveCamera as a pointer to a Camera

Implements nvsg::Camera.

virtual NVSG_API bool nvsg::StereoCamera::isDataShared void    const [virtual]
 

Determine whether the data of this object is shared.

Returns:
true if the object's data is shared, otherwise false.

Reimplemented from nvsg::Object.

virtual NVSG_API DataID nvsg::StereoCamera::getDataID void    const [virtual]
 

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::Object.

float nvsg::StereoCamera::getDepthFactor void    const [inline]
 

Get the depth factor.

The depth factor controls how much the two cameras are horizontally displaced from the base camera. It is measured in multiples of the target distance. A value of 0.0 results in monoscopic vision. A value of 0.03 (the default) gives a good stereo effect. You can imagine that the user is about one meter from the monitor and his eyes are about 0.03 meters displaced to the right and left. The larger the depth factor, the better the stereo effect, until the left and right images are too spread out for eyes to fuse.

void nvsg::StereoCamera::setDepthFactor float    df [inline]
 

Set the depth factor.

The depth factor controls how much the two cameras for stereo vision are horizontally displaced from the base camera. It is measured in multiples of the target distance. A value of 0.0 results in monoscopic vision. A value of 0.03 (the default) gives a good stereo effect. You can imagine that the user is about one meter from the monitor and his eyes are about 0.03 meters displaced to the right and left. The larger the depth factor, the better the stereo effect, until the left and right images are too spread out for the eyes to fuse.

Parameters:
df  new depth factor

float nvsg::StereoCamera::getFocusDistance void    const [inline]
 

Get the focal distance.

The focus distance controls where the focal plane is in the model. It is measured in the same units as the world space. A value equal to the near distance (the default) makes the near plane the focal plane. This results in a stereo image that seems to be completely inside of the monitor. A value equal to the far distance makes the far plane the focal plane. This results in a stereo image that seems to be completely in front of the monitor.

void nvsg::StereoCamera::setFocusDistance float    fd [inline]
 

Set the focus distance.

The focus distance controls where the focal plane is in the model. It is measured in the same units as the world space. A value equal to the near distance (the default) make the near plane the focal plane. This results in a stereo image that seems to be completely inside of the monitor. A value equal to the far distance makes the far plane the focal plane. This results in a stereo image that seems to be completely in front of the monitor.

Parameters:
fd  new focus distance

bool nvsg::StereoCamera::isLeftPassIndex size_t    pass const [inline]
 

Ask if pass is the left pass.

A stereo camera is a two pass camera. On rendering, the scene is traversed two times, once for the left eye and once for the right eye. Depending on the synchronization between the monitor and the stereo glasses, it might be important to know which pass is for the left eye and which pass for the right eye.

Returns:
true if pass is the index of the left pass, otherwise false
Parameters:
pass  pass index to ask for

void nvsg::StereoCamera::reverseLeftRight void    [inline]
 

Reverse left and right pass order.

A stereo camera is a two pass camera. On rendering, the scene is traversed two times, once for the left eye and once for the right eye. Depending on the synchronization between the monitor and the stereo glasses, it might be necessary to reverse this order to get the correct stereo effect.

NVSG_API void nvsg::StereoCamera::updateMonoCameras void    const
 

Update the monoscopic cameras (right and left).

Before traversing the monoscopic cameras (right and left) of a stereo camera, this function should be called to update these cameras with any changes that might have applied to the base camera.

const MonoCamera * nvsg::StereoCamera::getMonoCamera void    const [inline]
 

Get the base camera.

Returns:
a const poniter to the monoscopic base camera

const MonoCamera * nvsg::StereoCamera::getLeftCamera   const [inline]
 

Get the camera for the left eye.

Returns:
a constant pointer to the monoscopic camera representing the left eye.

const MonoCamera * nvsg::StereoCamera::getRightCamera   const [inline]
 

Get the camera for the right eye.

Returns:
a constant pointer to the monoscopic camera representing the right eye.

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

Add a head light on this camera.

A camera can have a number of headlights that are positioned relative to the camera, i.e. they move together with the camera. These lights are not part of the scene, but part of the camera. The default position and orientation of a new headlight is the camera position and orientation.

Parameters:
pLight  The light source to add
position  The position relative to the camera
quat  The rotation relative to the camera

Implements nvsg::Camera.

virtual NVSG_API size_t nvsg::StereoCamera::getNumberOfHeadLights void    const [virtual]
 

Get number of headlights attached to the camera.

Returns:
The number of headlights attached to camera

Implements nvsg::Camera.

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

Get the indexed head light of this camera.

Returns:
A constant pointer to the indexed headlight
Parameters:
index  index of head light to get

Implements nvsg::Camera.

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

Remove a headlight.

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

Implements nvsg::Camera.

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

Set the head light position and orientation relative to the camera.

Returns:
true if a headlight with this index exists, otherwise false
Parameters:
trans  position of headlight
quat  orientation of headlight
index  index of headlight

Implements nvsg::Camera.

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

Get the position/orientation of the indexed head light of this camera.

It is assumed that the camera holds at least index headlights.

Parameters:
trans  translation relative to the camera
quat  rotation relative to the camera
index  index of the headlight to get information from

Implements nvsg::Camera.

virtual NVSG_API float nvsg::StereoCamera::getTargetDistance void    const [virtual]
 

Get the distance to the target point.

Returns:
The distance to the target point

Implements nvsg::Camera.

virtual NVSG_API void nvsg::StereoCamera::setTargetDistance float    td [virtual]
 

Set the distance to the target point.

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

Implements nvsg::Camera.

virtual NVSG_API nvmath::Vec3f nvsg::StereoCamera::getUpVector void    const [virtual]
 

Get the up direction.

Returns:
The up direction of camera

Implements nvsg::Camera.

virtual NVSG_API const nvmath::Vec3f& nvsg::StereoCamera::getPosition void    const [virtual]
 

Get the camera position.

Returns:
The position of camera

Implements nvsg::Camera.

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

Set the camera position.

Parameters:
pos  position

Implements nvsg::Camera.

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

Set the up direction.

Parameters:
up  up direction (might change viewing direction)

Implements nvsg::Camera.

virtual NVSG_API nvmath::Vec3f nvsg::StereoCamera::getDirection void    const [virtual]
 

Get viewing direction.

The default viewing direction of a SimpleCamera is along the negative z-axis.

Returns:
The viewing direction

Implements nvsg::Camera.

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

Set the viewing direction.

Parameters:
dir  new viewing direction (might change upVector)

Implements nvsg::Camera.

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

Set the orientation of the camera.

Parameters:
quat  quaternion that determines direction and up vector

Implements nvsg::Camera.

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

Set the orientation of the camera.

Parameters:
dir  direction to look at
up  up vector

Implements nvsg::Camera.

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

Interface for setting the orientation of the camera.

Parameters:
axis  axis to rotate about
angle  angle to rotate

Implements nvsg::Camera.

virtual NVSG_API nvmath::Quatf nvsg::StereoCamera::getOrientation void    const [virtual]
 

Get the current orientation.

Returns:
quaternion that describes the orientation

Implements nvsg::Camera.

virtual NVSG_API nvmath::Mat44f nvsg::StereoCamera::getViewToWorldMatrix void    const [virtual]
 

Get the inverse of the camera specific world-to-view transformation.

Returns:
The inverse of the world-to-view transformation (i.e. view to world)

Implements nvsg::Camera.

virtual NVSG_API nvmath::Mat44f nvsg::StereoCamera::getWorldToViewMatrix void    const [virtual]
 

Get the world to view transformation.

Returns:
The world-to-camera transformation

Implements nvsg::Camera.

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

Get the window offset.

Returns:
The window offset

Implements nvsg::Camera.

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

Set the window offset.

Parameters:
offset  window ofset to viewing reference point

Implements nvsg::Camera.

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

Get the relative window region to view.

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

Implements nvsg::Camera.

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

Set the relative window region to view.

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

Implements nvsg::Camera.

virtual NVSG_API const nvmath::Vec2f& nvsg::StereoCamera::getWindowSize void    const [virtual]
 

Get the window size.

Returns:
The window size

Implements nvsg::Camera.

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

Set the window size.

Parameters:
size  window size (world coordinates)

Implements nvsg::Camera.

virtual NVSG_API float nvsg::StereoCamera::getAspectRatio void    const [virtual]
 

Get the current aspect ratio.

Returns:
The width versus height of the camera window

Implements nvsg::Camera.

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

Set the aspect ratio.

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

Implements nvsg::Camera.

virtual NVSG_API void nvsg::StereoCamera::setAutoClipPlanes bool    on [virtual]
 

Enable/Disable automatic clip plane determination.

Parameters:
on  true to enable, false to disable

Implements nvsg::Camera.

virtual NVSG_API bool nvsg::StereoCamera::isAutoClipPlanes void    const [virtual]
 

Get auto clipping state.

If auto clip is on, the camera determines the optimal near and front clipping distances out of 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

Implements nvsg::Camera.

virtual NVSG_API float nvsg::StereoCamera::getFarDistance void    const [virtual]
 

Get distance to the far clipping plane.

Near and far distances can be used internally to the camera to improve depth resolution.

Returns:
The distance to the far clipping plane

Implements nvsg::Camera.

virtual NVSG_API void nvsg::StereoCamera::setFarDistance float    fd [virtual]
 

Set the far clipping distance.

Parameters:
fd  far clipping distance

Implements nvsg::Camera.

virtual NVSG_API float nvsg::StereoCamera::getNearDistance void    const [virtual]
 

Get distance to the near clipping plane.

Near and far distances can be used internally to the camera to improve depth resolution.

Returns:
The distance to the near clipping plane

Implements nvsg::Camera.

virtual NVSG_API void nvsg::StereoCamera::setNearDistance float    nd [virtual]
 

Set the near clipping distance.

Parameters:
nd  near clipping distance

Implements nvsg::Camera.

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

Calculate the distances to the near and far clipping planes.

Near and far distances can be used internally to the camera to improve depth resolution. This function should determine these values such that the sphere given by center and radius just fits between them.

Parameters:
sphere  bounding sphere of the world to look at

Implements nvsg::Camera.

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

Move the camera.

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

Implements nvsg::Camera.

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

Orbit the camera.

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

Implements nvsg::Camera.

virtual NVSG_API void nvsg::StereoCamera::rotate const nvmath::Vec3f   axis,
float    rad,
bool    cameraRelative = true
[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

Implements nvsg::Camera.

virtual NVSG_API void nvsg::StereoCamera::zoom float    factor [virtual]
 

Zoom by a factor.

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

Implements nvsg::Camera.

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

Zoom to fit view to a sphere.

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

Implements nvsg::Camera.


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