pfvmNavigator(3pf) OpenGL Performer 3.2.2 libpfv C++ Reference Pages
NAMEpfvmNavigator - pfvViewer Module for Look-Around Navigation
FUNCTION SPECIFICATION
#include <Performer/pfvm/pfvmNavigator.h>
pfvmNavigator::pfvmNavigator();
int pfvmNavigator::setCoord( pfVec3& _xyz, pfVec3& _hpr );
int pfvmNavigator::getCoord( pfVec3&_xyz, pfVec3& _hpr );
int pfvmNavigator::setDefaultCoord( pfVec3& _xyz, pfVec3& _hpr );
int pfvmNavigator::getDefaultCoord( pfVec3& _xyz, pfVec3& _hpr );
int pfvmNavigator::getViewIndex();
void pfvmNavigator::setViewIndex(int i);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfvmNavigator is derived from the parent class
pfvModule, so each of these member functions of class pfvModule are also
directly usable with objects of class pfvmNavigator. This is also true
for ancestor classes of class pfvModule.
int pfvModule::getScope();
int pfvModule::getScopeIndex();
pfvObject* pfvModule::getScopeTarget();
int pfvModule::autoScope( int*scopeIndex );
void pfvModule::bindCallback(int which);
void pfvModule::unbindCallback(int which);
int pfvModule::getCBMask();
virtual void pfvModule::preConfig();
virtual void pfvModule::postConfig();
virtual void pfvModule::enterView(pfvView*v);
virtual void pfvModule::exitView(pfvView*v);
virtual void pfvModule::enterWorld();
virtual void pfvModule::exitWorld();
virtual void pfvModule::sync();
virtual void pfvModule::frame();
virtual void pfvModule::preCull(pfvDispChan*chan);
virtual void pfvModule::postCull(pfvDispChan*chan);
virtual void pfvModule::preDraw(pfvDispChan*chan);
virtual void pfvModule::postDraw(pfvDispChan*chan);
virtual void pfvModule::overlay(pfvDispChan*chan);
int pfvModule::bindKeys(char*keys);
int pfvModule::unbindKeys(char*keys)
char* pfvModule::getEventMask()
void pfvModule::setEventMask(char* str);
Page 1
pfvmNavigator(3pf) OpenGL Performer 3.2.2 libpfv C++ Reference Pages
virtual int pfvModule::handleEvent(int evType, char key);
uint64_t pfvModule::getViewMask();
Since the class pfvModule is itself derived from the parent class
pfvobject, objects of class pfvmNavigator can also be used with these
functions designed for objects of class pfvobject.
virtual int pfvObject::parseXml(pfvXmlNode*xml);
virtual int pfvObject::setXmlField(pfvXmlNode*xml);
char* pfvObject::getName();
void pfvObject::setName(char*_name);
Since the class pfvobject is itself derived from the parent class
pfObject, objects of class pfvmNavigator can also be used with these
functions designed for objects of class pfObject.
void* pfObject::operator new(size_t);
void* pfObject::operator new(size_t, pfFluxMemory *fmem);
void pfObject::setUserData(void *data);
void pfObject::setUserData(int slot, void *data);
void* pfObject::getUserData(pfObject *obj);
void* pfObject::getUserData(pfObject *obj, int slot);
int pfObject::getNumUserData();
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfvmNavigator can also be used with these
functions designed for objects of class pfMemory.
void* pfMemory::getData(const void *ptr);
pfType * pfMemory::getType();
int pfMemory::isOfType(pfType *type);
int pfMemory::isExactType(pfType *type);
const char * pfMemory::getTypeName();
int pfMemory::copy(pfMemory *src);
int pfMemory::compare(const pfMemory *mem);
void pfMemory::print(uint which, uint verbose, char *prefix,
FILE *file);
int pfMemory::getArena(void *ptr);
void* pfMemory::getArena();
int pfMemory::ref();
int pfMemory::unref();
int pfMemory::unrefDelete();
int pfMemory::unrefGetRef();
int pfMemory::getRef();
int pfMemory::checkDelete();
int pfMemory::isFluxed();
void * pfMemory::getArena();
Page 2
pfvmNavigator(3pf) OpenGL Performer 3.2.2 libpfv C++ Reference Pages
int pfMemory::getSize();
DESCRIPTIONpfvmNavigator is a pfvViewer module that allows user to navigate 3d
scenes in a Look-Around fashion using mouse and keyboard input.
setCoord() will set current eye position to the provided xyz and hpr
values.
getCoord() will return the last eye position (xyz,hpr) computed by
pfvmNavigator.
setDefaultCoord() will set navigator's default eye position to xyz, hpr.
getDefaultCoord() will return navigator's default eye position (xyz,hpr).
getViewIndex() will return the index of the pfvView that pfvmNavigator is
navigating. See notes on module scoping below for more details.
setViewIndex() specifies the index of the pfvView that pfvmNavigator will
be navigating. Note that currently, view index is over-written by
pfvmNavigator in its postConfig callback, and the recommended way to
associate pfvmNavigator modules to specific views is to scope them
accordingly.
Navigation with the pfvmNavigator module works as follows:
o Hold left and right mouse buttons to strafe sideways
or move vertically.
o Hold middle mouse button to change heading and pitch,
and to carry on moving at current speed. Left clicking
while holding middle button down will accellerate;
o Right clicking while holding middle button down will
slow down (and eventually move backwards).
o Hold all three mouse buttons down together to go back
to default position.
Note that navgation parameters such as max speed, accell rate, reset
position, etc are read from an xml configuration file. S
========
XML tags
========
Page 3
pfvmNavigator(3pf) OpenGL Performer 3.2.2 libpfv C++ Reference Pages
<module>
<class>pfvmNavigator</class>
<data>
...
parameters
...
</data>
</module>
where parameters is one or more of the following:
<viewIndex>int</viewIndex> specifies the index of the pfvView that
pfvmNavigator will be navigating. Use of this token is not recommended.
<dzone>float</dzone> specifies the fraction of the screen area over which
mouse will not cause navigator to change heading or pitch. Default value
is 0.1.
<deltaH>float</deltaH> specifies the rate of change in the value of
Heading between consecutive frames. This value is multiplied by the
horizontal distance between mouse and center of screen when user is
rotating viewpoint. Default value is 0.1,
<deltaP>float</deltaP> specifies the rate of change in the value of Pitch
between consecutive frames. This value is multiplied by the vertical
distance between mouse and center of screen when user is rotating
viewpoint. Default value is 0.1,
<initSpeed>float</initSpeed> specifies the speed of forward motion on the
very first frame when user starts moving. The default value is 0.001.
When accellerating or decellerating, current speed is multiplied (or
divided) by a constant value, leading to an exponential speedup/slowdown.
When slowing down, as soon as speed falls below a minimum value,
direction of motion is reversed.
<minSpeed>float</minSpeed> specifies the minimum speed mentioned above.
The default value is 0.0004.
<maxSpeed>float</maxSpeed> specifies the maximum forward/backward motion
speed. The default value is 0.03.
<deltaSpeed>float</deltaSpeed> specifies the constant value by which
speed is multiplied or divided when speeding up or slowing down. The
default value is 1.03.
<deltaStrafe>float</deltaStrafe> specifies the speed at which strafing
will occcur. This value is multiplied by the horizontal distance between
mouse and center of screen when user is strafing. Default value is 0.05.
Page 4
pfvmNavigator(3pf) OpenGL Performer 3.2.2 libpfv C++ Reference Pages
<deltaZ>float</deltaZ> specifies the speed at which vertical motion will
occcur. This value is multiplied by the vertical distance between mouse
and center of screen when user is moving vertically. Default value is
0.05.
<default_xyz>float,float,float</default_xyz> specifies the reset eye
position.
<default_hpr>float,float,float</default_hpr> pecifies the reset eye
orientation.
=======
Scoping
=======
A pfvmNavigator module can be scoped globally or to a single view.
If scoped to a specific view, pfvmNavigator will respond to input over
that view only and will navigate eyepoint for that view.
If scoped globally, pfvmNavigator will respond to input over view0 (the
first view in pfvViewer's view-list), and will navigate its eyepoint.
Scoping pfvmNavigator modules to specific pfvWorlds is not supported.
NOTES
The source code for the pfvmNavigator Module is provided and can be found
in /usr/share/Performer/src/pguide/libpfv/viewer/modules/pfvmNavigator
For examples of pfvViewer XML configuration files, look at the sample
.pfv files in /usr/share/Performer/config.
SEE ALSO
pfvModule, pfvViewer, pfvXml
Page 5