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

nvui::FlightCamManip Class Reference

Flight Camera Manipulator Class. More...

#include <FlightCamManip.h>

Inheritance diagram for nvui::FlightCamManip:

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

Collaboration graph
[legend]
List of all members.

Public Types

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


Public Methods

NVSG_API FlightCamManip (void)
 Default constructor. More...

NVSG_API ~FlightCamManip (void)
 Default destructor. More...

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

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

bool isFly (void)
 Signals if the manipulator is in fly 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 setVSensitivity (float sensitivity)
 Define vertical sensitivity. More...

float getVSensitivity ()
 Get the vertical 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...

void fly (void)
 Do the camera fly. More...

bool isFlyForward (void)
 Signals if the manipulator is in forward flying mode. More...

bool isFlyBackward (void)
 Signals if the manipulator is in backward flying mode. 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_vSensitivity
 Factor that influences the vertical rotation. Default: 1.0. More...

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


Static Protected Attributes

NVSG_API const UINT FLYFORWARD
 Key/button configuration flying. More...

NVSG_API const UINT FLYBACKWARD
 Key/button configuration flying. More...

NVSG_API const UINT INCREASESPEED
 Key/button configuration flying. More...

NVSG_API const UINT DECREASESPEED
 Key/button configuration flying. More...

NVSG_API const float AREAOFPEACE
 Size if the area where the mouse does not trigger the manipulator. More...


Detailed Description

Flight Camera Manipulator Class.

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

Keys & Buttons
Left mouse button : Fly forward.
Middle mouse button : Fly backward.
W-key : Increase speed.
S-key : Decrease speed.

Note:
If you use this manipulator, then 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.


Member Enumeration Documentation

anonymous enum
 

Additional keys for flying.

Enumeration values:
_W_KEY  Fly forward.
_S_KEY  Fly backward.


Constructor & Destructor Documentation

NVSG_API nvui::FlightCamManip::FlightCamManip void   
 

Default constructor.

NVSG_API nvui::FlightCamManip::~FlightCamManip void   
 

Default destructor.


Member Function Documentation

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

Apply the states to the camera.

Recalculate the camera regarding the manipulator states.

Implements nvui::CameraManipulator.

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

Handle key repeats.

Adapt key repeats.

Reimplemented from nvui::CameraManipulator.

bool nvui::FlightCamManip::isFly void    [inline]
 

Signals if the manipulator is in fly mode.

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

Returns:
true: manipulator is in walk mode

void nvui::FlightCamManip::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::FlightCamManip::setWorldUpVector nvmath::Vec3f    up [inline]
 

Set the world up-vector.

Define where the 'sky' is.

Parameters:
up  World up-vector

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

Get the world up-vector.

Returns:
Up-vector of the world pointing to the 'sky'

void nvui::FlightCamManip::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::FlightCamManip::getSpeedIncreaseFactor   [inline]
 

Get the speed increase factor.

Returns:
Speed increase factor.

void nvui::FlightCamManip::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::FlightCamManip::getHSensitivity   [inline]
 

Get the horizontal sensitivity.

Returns:
Horizontal sensitivity factor.

void nvui::FlightCamManip::setVSensitivity float    sensitivity [inline]
 

Define vertical sensitivity.

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

Parameters:
sensitivity  Sensitivity factor - default 1.f

float nvui::FlightCamManip::getVSensitivity   [inline]
 

Get the vertical sensitivity.

Returns:
Vertical sensitivity factor.

void nvui::FlightCamManip::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::FlightCamManip::getSpeed   [inline]
 

Get the movement speed.

Returns:
Speed value.

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

Map your keys.

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

Reimplemented from nvui::CameraManipulator.

void nvui::FlightCamManip::fly void    [protected]
 

Do the camera fly.

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

bool nvui::FlightCamManip::isFlyForward void    [inline, protected]
 

Signals if the manipulator is in forward flying mode.

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

Returns:
true: manipulator is in forward walking mode

bool nvui::FlightCamManip::isFlyBackward void    [inline, protected]
 

Signals if the manipulator is in backward flying mode.

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

Returns:
true: manipulator is in forward walking mode


Member Data Documentation

UINT nvui::FlightCamManip::m_ScreenSizeX [protected]
 

Width of the screen (pixels).

UINT nvui::FlightCamManip::m_ScreenSizeY [protected]
 

Height of the screen (pixels).

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

Up-vector of the world.

float nvui::FlightCamManip::m_speedIncreaseFactor [protected]
 

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

float nvui::FlightCamManip::m_hSensitivity [protected]
 

Factor that influences the horizontal rotation. Default: 1.0.

float nvui::FlightCamManip::m_vSensitivity [protected]
 

Factor that influences the vertical rotation. Default: 1.0.

float nvui::FlightCamManip::m_speed [protected]
 

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

NVSG_API const UINT nvui::FlightCamManip::FLYFORWARD [static, protected]
 

Key/button configuration flying.

NVSG_API const UINT nvui::FlightCamManip::FLYBACKWARD [static, protected]
 

Key/button configuration flying.

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

Key/button configuration flying.

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

Key/button configuration flying.

NVSG_API const float nvui::FlightCamManip::AREAOFPEACE [static, protected]
 

Size if 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:43 2005 for NVSGSDK by NVIDIA