| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/sg/jumpnavigation.h>

Public Member Functions | |
| JumpNavigation (const Vector &onPlane, LookAt *lookAt, double duration=6.0) | |
| void | setScaling (double horizontal=1.0, double vertical=1.0) |
| double | getHorizontalScaling () const |
| double | getVerticalScaling () const |
| void | setKeyCodes (Iterator< unsigned int > *startKeys, Iterator< unsigned int > *storeKeys, InputEvent::Modifier startModifier=InputEvent::NoModifier, InputEvent::Modifier storeModifier=InputEvent::Ctrl) |
| void | initPath (const std::string &camName, bool accelerate=true, bool decelerate=true) |
| void | initPath (const Vector &endPos, const Vector &endDir, bool accelerate=true, bool decelerate=true, const Vector &endUp=Vector(0.0, 1.0, 0.0)) |
| void | initMultiStepPath (Array< Vector > *positions, Array< Vector > *directions) |
| void | enableKeys () |
| void | disableKeys () |
| void | setNavMode (Navigation::NavMode mode) |
| Change the currently used navigation metaphor. | |
| void | setDuration (double duration) |
| Set path time. | |
| double | getDuration () const |
| Get path time. | |
| bool | pathActive () const |
| Returns true if the Navigation is currently following a path. | |
| void | stopPath () |
| Stops the current path immediately. | |
| virtual BehaviorNode::InvalidationHint | handle (Event *event) |
| void | savePath (const std::string &fileName) |
| void | loadPath (const std::string &fileName) |
| void | enableLoadSaveKeys (const std::string &filename, unsigned char loadKey, unsigned char saveKey) |
| void | disableLoadSaveKeys () |
| VRS_TYPEINFO (JumpNavigation, Navigation) | |
| VRS_SERIALIZABLE (JumpNavigation) | |
Static Public Member Functions | |
| static void | useAlternativeImplementation (bool yesNo) |
Protected Member Functions | |
| JumpNavigation () | |
| VRS::JumpNavigation::JumpNavigation | ( | const Vector & | onPlane, | |
| LookAt * | lookAt, | |||
| double | duration = 6.0 | |||
| ) |
A JumpNavigation is bound to a specific "ground plane", which is defined by onPlane and the up vector of the given lookAt at construction time. The up vector of lookAt is never changed by the navigation and should not be changed from outside. Otherwise the lookAt could be degenerate, which results in an assertion invoked by the lookAt object during rendering. Since each JumpNavigation is bound to a specific LookAt object, the lookAt parameter must not be NULL.
| VRS::JumpNavigation::JumpNavigation | ( | ) | [protected] |
| void VRS::JumpNavigation::setScaling | ( | double | horizontal = 1.0, |
|
| double | vertical = 1.0 | |||
| ) |
Camera paths between different views are specified by several parameters that were quite inconvenient to specify explicitly. By default all parameters are chosen in a way that it creates "reasonable" paths in a scene that is scaled to the [0,1]-cube. SetScaling() enables to specify several parameters at once by "scaling" the navigation. Thereby the scale factor can be specified seperately for horziontal and vertical movement. The parameters horizontal and vertical must be positive.
| double VRS::JumpNavigation::getHorizontalScaling | ( | ) | const |
| double VRS::JumpNavigation::getVerticalScaling | ( | ) | const |
By default (i.e. without any prior setScaling()-call both methods return 1.
| void VRS::JumpNavigation::setKeyCodes | ( | Iterator< unsigned int > * | startKeys, | |
| Iterator< unsigned int > * | storeKeys, | |||
| InputEvent::Modifier | startModifier = InputEvent::NoModifier, |
|||
| InputEvent::Modifier | storeModifier = InputEvent::Ctrl | |||
| ) |
Key codes to store and recover views can be specified explicitly by two key code iterators or by a key code iterator and two modifiers. A keyCode iterator must not be Null. In the first overload startKeys and storeKeys must be of same length. In the second startModifier and storeModifier must not be equal.
| void VRS::JumpNavigation::initPath | ( | const std::string & | camName, | |
| bool | accelerate = true, |
|||
| bool | decelerate = true | |||
| ) |
| void VRS::JumpNavigation::initPath | ( | const Vector & | endPos, | |
| const Vector & | endDir, | |||
| bool | accelerate = true, |
|||
| bool | decelerate = true, |
|||
| const Vector & | endUp = Vector(0.0, 1.0, 0.0) | |||
| ) |
If accelerate is true, the navigation starts with a smooth acceleration phase. If decelerate is true, the navigation ends with a smooth decelration phase when reaching the desired position.
| void VRS::JumpNavigation::initMultiStepPath | ( | Array< Vector > * | positions, | |
| Array< Vector > * | directions | |||
| ) |
Starts a navigation to several views successively. The arrays must contain the positions and directions to fly to. The arrays must contain the same number of elements.
| void VRS::JumpNavigation::enableKeys | ( | ) |
| void VRS::JumpNavigation::disableKeys | ( | ) |
Since one should not be forced to use the JumpNavigation via control keys, enbaleKeys() and initPath() allow the use explicit use of a JumpNavigation object. key activation is disabled by enableKeys(false), and an interpolation of two different views is invoked by initPath(endPos, endDir). The start position and start direction are taken from the associated lookAt object.
| void VRS::JumpNavigation::setNavMode | ( | Navigation::NavMode | mode | ) | [virtual] |
| void VRS::JumpNavigation::setDuration | ( | double | duration | ) |
Set path time.
| double VRS::JumpNavigation::getDuration | ( | ) | const |
Get path time.
| bool VRS::JumpNavigation::pathActive | ( | ) | const |
Returns true if the Navigation is currently following a path.
| void VRS::JumpNavigation::stopPath | ( | ) |
Stops the current path immediately.
| virtual BehaviorNode::InvalidationHint VRS::JumpNavigation::handle | ( | Event * | ) | [virtual] |
An interaction process can receive and propagate canvas events. Other events are ignored. According to the conditions, `handle' triggers the start, process, end, and abort methods.
Reimplemented from VRS::Navigation.
| void VRS::JumpNavigation::savePath | ( | const std::string & | fileName | ) |
| void VRS::JumpNavigation::loadPath | ( | const std::string & | fileName | ) |
Saves/Loads the recorded path in a simple ASCII file.
| void VRS::JumpNavigation::enableLoadSaveKeys | ( | const std::string & | filename, | |
| unsigned char | loadKey, | |||
| unsigned char | saveKey | |||
| ) |
| void VRS::JumpNavigation::disableLoadSaveKeys | ( | ) |
Allows to activate the loadPath/savePath methods per key
| static void VRS::JumpNavigation::useAlternativeImplementation | ( | bool | yesNo | ) | [static] |
| VRS::JumpNavigation::VRS_TYPEINFO | ( | JumpNavigation | , | |
| Navigation | ||||
| ) |
| VRS::JumpNavigation::VRS_SERIALIZABLE | ( | JumpNavigation | ) |