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

nvui::WalkCamManip Class Reference

Walk Camera Manipulator Class. More...

#include <WalkCamManip.h>

Inheritance diagram for nvui::WalkCamManip:

Inheritance graph
[legend]
Collaboration diagram for nvui::WalkCamManip:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { _W_KEY = 0x0400, _S_KEY = 0x0800 }
 Additional keys for walking. More...


Public Methods

NVSG_API WalkCamManip (void)
 Default Constructor. More...

NVSG_API ~WalkCamManip (void)
 Default Destructor. More...

virtual NVSG_API void keyRepeat ()
 Handle key repeats. More...

virtual NVSG_API void apply ()
 Apply the states to the camera. More...

bool isWalk (void)
 Signals if the manipulator is in walk mode. More...

bool isTranslate (void)
 Signals if the manipulator is in translation mode. More...

bool isTilt (void)
 Signals if the manipulator is in tilting mode. More...

void setScreenSize (UINT x, UINT y)
 Set the screen size. More...

void setWorldUpVector (nvmath::Vec3f up)
 Set the world up-vector. More...

const nvmath::Vec3fgetWorldUpVector ()
 Get the world up-vector. More...

void setSpeedIncreaseFactor (float factor)
 Define speed increase factor. More...

float getSpeedIncreaseFactor ()
 Get the speed increase factor. More...

void setHSensitivity (float sensitivity)
 Define horizontal sensitivity. More...

float getHSensitivity ()
 Get the horizontal sensitivity. More...

void setSpeed (float speed)
 Set the speed. More...

float getSpeed ()
 Get the movement speed. More...


Protected Methods

virtual NVSG_API UINT convertKey (UINT key)
 Map your keys. More...

bool isWalkForward (void)
 Signals if the manipulator is in forward walking mode. More...

bool isWalkBackward (void)
 Signals if the manipulator is in backward walking mode. More...

virtual NVSG_API void walk (void)
 Do the camera walk. More...

virtual NVSG_API void translate (void)
 Do the camera translate. More...

virtual NVSG_API void tilt (void)
 Do the camera tilt. More...


Protected Attributes

UINT m_ScreenSizeX
 width of the screen (pixels). More...

UINT m_ScreenSizeY
 height of the screen (pixels). More...

nvmath::Vec3f m_worldUpVector
 Up-vector of the world. More...

float m_speedIncreaseFactor
 Factor that influences the stepping. Default: 2.0 NOTE: This factor must not be 0! More...

float m_hSensitivity
 Factor that influences the horizontal rotation. Default: 1.0. More...

float m_speed
 Walk speed. Controlled via key or button input. Default: 1.0. More...


Static Protected Attributes

NVSG_API const UINT WALKFORWARD
 Key/button configuration walking. More...

NVSG_API const UINT WALKBACKWARD
 Key/button configuration walking. More...

NVSG_API const UINT TRANSLATE
 Key/button configuration for translating up, down, left and right. More...

NVSG_API const UINT TILT
 Key/button configuration looking left, right, up and down. More...

NVSG_API const UINT INCREASESPEED
 Key/button configuration speed up. More...

NVSG_API const UINT DECREASESPEED
 Key/button configuration slow down. More...

NVSG_API const UINT AREAOFPEACE
 Size of the area where the mouse does not trigger the manipulator. More...


Detailed Description

Walk Camera Manipulator Class.

This manipulator is a special CameraManipulator that interprets/converts mouse movement into walk-through camera movements.

Keys & Buttons
Left mouse button : Walk forward.
Middle mouse button : Walk backward.
W-key : Increase speed.
S-key : Decrease speed.
Ctrl + Left mouse button : Tilt.
Ctrl + Middle mouse button : Pan.

Note:
If you use this manipulator your application must use a mechanism (such as a small thread that triggers redraw, etc. ) that provides continuous camera updates when walking forward or backward.

If you implement your own manipulator, refer to the button state configuration to see how to add additional button combinations in the same way.


Member Enumeration Documentation

anonymous enum
 

Additional keys for walking.

Enumeration values:
_W_KEY  Speed up.
_S_KEY  Speed up.


Constructor & Destructor Documentation

NVSG_API nvui::WalkCamManip::WalkCamManip void   
 

Default Constructor.

NVSG_API nvui::WalkCamManip::~WalkCamManip void   
 

Default Destructor.


Member Function Documentation

virtual NVSG_API void nvui::WalkCamManip::keyRepeat   [virtual]
 

Handle key repeats.

Adapt key repeats.

Reimplemented from nvui::CameraManipulator.

virtual NVSG_API void nvui::WalkCamManip::apply   [virtual]
 

Apply the states to the camera.

Recalculate the camera with respect to the manipulator states.

Implements nvui::CameraManipulator.

bool nvui::WalkCamManip::isWalk void    [inline]
 

Signals if the manipulator is in walk mode.

This method compares the current button or key state with the configured button states of this object. e.g. TRANSLATE1

Returns:
true: manipulator is in walk mode

bool nvui::WalkCamManip::isTranslate void    [inline]
 

Signals if the manipulator is in translation mode.

This method compares the current button or key state with the configured button states of this object. e.g. TRANSLATE1

Returns:
true: manipulator is in translation mode

bool nvui::WalkCamManip::isTilt void    [inline]
 

Signals if the manipulator is in tilting mode.

This method compares the current button or key state with the configured button states of this object. e.g. TRANSLATE1

Returns:
true: manipulator is in tilting mode

void nvui::WalkCamManip::setScreenSize UINT    x,
UINT    y
[inline]
 

Set the screen size.

Set the screen resolution. The resolution is needed for the sensitivity of the manipulator. Default is 1280x1024.

Parameters:
x  width of the screen (pixels) - must not be 0
y  height of the screen (pixels) - must not be 0

void nvui::WalkCamManip::setWorldUpVector nvmath::Vec3f    up [inline]
 

Set the world up-vector.

Define where the 'sky' is.

Parameters:
up  World up-vector

const nvmath::Vec3f & nvui::WalkCamManip::getWorldUpVector   [inline]
 

Get the world up-vector.

Returns:
Vector of the world pointing to the 'sky'

void nvui::WalkCamManip::setSpeedIncreaseFactor float    factor [inline]
 

Define speed increase factor.

The current speed will be multiplied or divided by this factor

Parameters:
factor  Speed increase factor - default 2.f
Note:
This factor must not be 0!

float nvui::WalkCamManip::getSpeedIncreaseFactor   [inline]
 

Get the speed increase factor.

Returns:
Speed increase factor.

void nvui::WalkCamManip::setHSensitivity float    sensitivity [inline]
 

Define horizontal sensitivity.

The horizontal sensitivity is a factor that influences how sensitive the manipulator reacts to horizontal rotation changes

Parameters:
sensitivity  Sensitivity factor - default 1.f

float nvui::WalkCamManip::getHSensitivity   [inline]
 

Get the horizontal sensitivity.

Returns:
Horizontal sensitivity factor.

void nvui::WalkCamManip::setSpeed float    speed [inline]
 

Set the speed.

This parameter controls the speed of the camera movement

Parameters:
speed  Speed value - default 1.f

float nvui::WalkCamManip::getSpeed   [inline]
 

Get the movement speed.

Returns:
Speed value.

virtual NVSG_API UINT nvui::WalkCamManip::convertKey UINT    key [protected, virtual]
 

Map your keys.

Returns:
Manipulator key code
Parameters:
key  External key code.

Reimplemented from nvui::CameraManipulator.

bool nvui::WalkCamManip::isWalkForward void    [inline, protected]
 

Signals if the manipulator is in forward walking mode.

This method compares the current button or key state with the configured button states of this object. e.g. TRANSLATE1

Returns:
true: manipulator is in forward walking mode

bool nvui::WalkCamManip::isWalkBackward void    [inline, protected]
 

Signals if the manipulator is in backward walking mode.

This method compares the current button or key state with the configured button states of this object. e.g. TRANSLATE1

Returns:
true: manipulator is in backward walking mode

virtual NVSG_API void nvui::WalkCamManip::walk void    [protected, virtual]
 

Do the camera walk.

Walk forward or backward. You can simply replace it with your own way to handle this.

virtual NVSG_API void nvui::WalkCamManip::translate void    [protected, virtual]
 

Do the camera translate.

Translate the camera perpendicular to the movement plane. (up, down, left and right) You can simply replace it with your own way to handle this.

virtual NVSG_API void nvui::WalkCamManip::tilt void    [protected, virtual]
 

Do the camera tilt.

Tilt the camera. You rotate the camera in place so you can look at your feet, up into the sky, or rotate left and right. You can simply replace it with your own way to handle this.


Member Data Documentation

UINT nvui::WalkCamManip::m_ScreenSizeX [protected]
 

width of the screen (pixels).

UINT nvui::WalkCamManip::m_ScreenSizeY [protected]
 

height of the screen (pixels).

nvmath::Vec3f nvui::WalkCamManip::m_worldUpVector [protected]
 

Up-vector of the world.

float nvui::WalkCamManip::m_speedIncreaseFactor [protected]
 

Factor that influences the stepping. Default: 2.0 NOTE: This factor must not be 0!

float nvui::WalkCamManip::m_hSensitivity [protected]
 

Factor that influences the horizontal rotation. Default: 1.0.

float nvui::WalkCamManip::m_speed [protected]
 

Walk speed. Controlled via key or button input. Default: 1.0.

NVSG_API const UINT nvui::WalkCamManip::WALKFORWARD [static, protected]
 

Key/button configuration walking.

NVSG_API const UINT nvui::WalkCamManip::WALKBACKWARD [static, protected]
 

Key/button configuration walking.

NVSG_API const UINT nvui::WalkCamManip::TRANSLATE [static, protected]
 

Key/button configuration for translating up, down, left and right.

NVSG_API const UINT nvui::WalkCamManip::TILT [static, protected]
 

Key/button configuration looking left, right, up and down.

NVSG_API const UINT nvui::WalkCamManip::INCREASESPEED [static, protected]
 

Key/button configuration speed up.

NVSG_API const UINT nvui::WalkCamManip::DECREASESPEED [static, protected]
 

Key/button configuration slow down.

NVSG_API const UINT nvui::WalkCamManip::AREAOFPEACE [static, protected]
 

Size of the area where the mouse does not trigger the manipulator.


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