pfiXformer(3pf) OpenGL Performer 3.2.2 libpfui Reference Pages
NAME
pfiInit, pfiGetXformerClassType, pfiNewXformer, pfiXformerModel,
pfiSelectXformerModel, pfiGetXformerCurModel, pfiGetXformerCurModelIndex,
pfiRemoveXformerModel, pfiRemoveXformerModelIndex, pfiStopXformer,
pfiResetXformer, pfiResetXformerPosition, pfiCenterXformer,
pfiXformerAutoInput, pfiXformerMat, pfiGetXformerMat, pfiXformerModelMat,
pfiGetXformerModelMat, pfiXformerCoord, pfiGetXformerCoord,
pfiXformerResetCoord, pfiGetXformerResetCoord, pfiXformerNode,
pfiGetXformerNode, pfiXformerAutoPosition, pfiGetXformerAutoPosition,
pfiXformerLimits, pfiGetXformerLimits, pfiEnableXformerCollision,
pfiDisableXformerCollision, pfiGetXformerCollisionEnable,
pfiXformerCollision, pfiGetXformerCollisionStatus, pfiUpdateXformer,
pfiCollideXformer - Performer utility module for managing a collection of
motion models.
FUNCTION SPECIFICATION
#include <Performer/pfui.h>
void pfiInit(void);
extern pfType* pfiGetXformerClassType(void);
pfiXformer * pfiNewXformer(void* arena);
void pfiXformerModel(pfiXformer* xf, int index,
pfiInputXform* model);
void pfiSelectXformerModel(pfiXformer* xf, int which);
pfiInputXform * pfiGetXformerCurModel(pfiXformer* xf);
int pfiGetXformerCurModelIndex(pfiXformer* xf);
int pfiRemoveXformerModel(pfiXformer* xf, int index);
int pfiRemoveXformerModelIndex(pfiXformer* xf,
pfiInputXform* model);
void pfiStopXformer(pfiXformer* xf);
void pfiResetXformer(pfiXformer* xf);
void pfiResetXformerPosition(pfiXformer* xf);
void pfiCenterXformer(pfiXformer* xf);
void pfiXformerAutoInput(pfiXformer* xf, pfChannel* chan,
pfuMouse* mouse, pfuEventStream* events);
void pfiXformerMat(pfiXformer* xf, PFMATRIX mat);
Page 1
pfiXformer(3pf) OpenGL Performer 3.2.2 libpfui Reference Pages
void pfiGetXformerMat(pfiXformer* xf, PFMATRIX mat);
void pfiXformerModelMat(pfiXformer* xf, PFMATRIX mat);
void pfiGetXformerModelMat(pfiXformer* xf, PFMATRIX mat);
void pfiXformerCoord(pfiXformer* xf, pfCoord *coord);
void pfiGetXformerCoord(pfiXformer* xf, pfCoord *coord);
void pfiXformerResetCoord(pfiXformer* xf,
pfCoord *resetPos);
void pfiGetXformerResetCoord(pfiXformer* xf,
pfCoord *resetPos);
void pfiXformerNode(pfiXformer* xf, pfNode *node);
pfNode * pfiGetXformerNode(pfiXformer* xf);
void pfiXformerAutoPosition(pfiXformer* xf, pfChannel *chan,
pfDCS *dcs);
void pfiGetXformerAutoPosition(pfiXformer* xf,
pfChannel **chan, pfDCS **dcs);
void pfiXformerLimits(pfiXformer* xf, float maxSpeed,
float angularVel, float maxAccel, pfBox* dbLimits);
void pfiGetXformerLimits(pfiXformer* xf, float *maxSpeed,
float *angularVel, float *maxAccel,
pfBox* dbLimits);
void pfiEnableXformerCollision(pfiXformer* xf);
void pfiDisableXformerCollision(pfiXformer* xf);
int pfiGetXformerCollisionEnable(pfiXformer* xf);
void pfiXformerCollision(pfiXformer* xf, int mode,
float val, pfNode* node);
int pfiGetXformerCollisionStatus(pfiXformer* xf);
void pfiUpdateXformer(pfiXformer* xf);
int pfiCollideXformer(pfiXformer* xf);
typedef struct _pfiXformer pfiXformer;
Page 2
pfiXformer(3pf) OpenGL Performer 3.2.2 libpfui Reference Pages
PARAMETERS
xf identifies a pfiXformer.
DESCRIPTIONpfiXformer is a facility developed to address the common task of updating
a transformation matrix based on a vehicle motion model and control input
from a user. A transformation matrix is computed using a motion model
selected from a list of possible motion models maintained by the
pfiXformer. This transformation matrix can then be used to update a
pfChannel's view specification (pfChanViewMat) or a pfDCS node's matrix,
or the pfiXformer can update these elements automatically if specified
with pfiXformerAutoPosition. pfiXformerAutoInput can be used to set up
mouse-based input to the pfiXformer.
A pfiXformer is a child of the pfiInputXform class and so pfiInputXform
routines may be called with a pfiXformer. See the pfiInputXform
reference page for information on pfiInputXform functionality.
Functionality specific to the pfiXformer are discussed here. The
pfiXformer has a complete C++ API (more complete than the C API)
following the conventions of general OpenGL Performer C++ API; C++
methods are declared in /usr/include/Performer/pfui/pfiXformer.h. This
reference page only discusses the C API.
pfiInit should be called once before any pfiXformer routines and before
the forked creation of any additional processes that will be calling
pfiXformer routines.
pfiGetXformerClassType returns the pfType* for the class pfiXformer.
Because OpenGL Performer allows subclassing of built-in types, when
decisions are made based on the type of an object, it is usually better
to use pfIsOfType to test if an object is of a type derived from a
Performer type rather than to test for strict equality of the pfType*'s.
pfiNewXformer creates a new pfiXformer data structure as described above
and returns a pointer to that structure. arena should specify the shared
arena handle returned by pfGetSharedArena or from the process dynamic
memory area.
pfiXformerAutoInput causes the pfiXformer to use the specified mouse and
channel when collecting user input. These structures will be examined
every frame, typically xf when pfiUpdateXformer is called.
pfiUpdateXformer should be called every frame and will "update" xf based
on the input structures specified in pfiXformerAutoInput and the
currently selected motion model.
pfiXformerAutoPosition will cause the pfiXformer to automatically update
the view and position matrices of chan and dcs automatically. One or
both of chan or dcs may be NULL to prevent channel or dcs updates.
pfiXformerCollision specifies with what types of objects xf should
collide. mode is a bit field that will be bitwise OR-ed into the
collision mode of xf. Possible modes are PFICOLLIDE_GROUND and
Page 3
pfiXformer(3pf) OpenGL Performer 3.2.2 libpfui Reference Pages
PFICOLLIDE_OBJECT. val specifies the minimum distance from xf's origin
to an object or to the ground at which xf is considered to have collided
with that object. node specifies the root of the subtree of the scene
graph against which xf will check for collisions.
pfiGetXformerCollisionStatus returns whether or not xf is currently
colliding with something.
pfiXformerLimits sets the maximum speed of xf to maxSpeed, the angular
velocity of xf to angularVel, the maximum acceleration of xf to maxAccel
and the bounds within which xf can move to be the pfBox dbLimits.
pfiGetXformerLimits returns everything set by pfiXformerLimits.
pfiXformerModel sets model to put at location index in the motion model
list of xf.
pfiSelectXformerModel causes the motion model at location which in the
motion model list of xf to be the current active motion model of xf.
pfiGetXformerCurModelIndex will return the index of the current active
motion model for xf.
pfiRemoveXformerModel will remove model from the motion model list of xf.
pfiRemoveXformerModelIndex will replace the motion model at index from
the motion model list of xf with NULL.
pfiXformerMat sets the current pfiXformer matrix to mat thus resetting
xf's transformation matrix to mat. Note that this also causes the xf's
position as specified in the coord field of the pfiXformer to be updated.
pfiGetXformerMat returns xf's current transform matrix by copying it into
mat.
pfiXformerModelMat sets the current transform matrix of the current
motion model of xf to mat thus resetting xf's transformation matrix to
mat. Note that this also causes the xf's position as specified in the
coord field of the pfiXformer to be updated. pfiGetXformerModelMat
returns the transform matrix of the current motion model of xf by copying
it into mat.
pfiXformerCoord sets the current position of the pfiXformer xf to coord
and then recalculates the overall pfiXformer matrix again based on this
new position. Note that positions are absolute and not relative to
previous positions. pfiGetXformerCoord returns the position currently
specified by the pfiXformer xf by copying it into coord.
pfiXformerNode causes the pfiXformer to use node to automatically compute
database limits and size based on the scene graph rooted at node. If the
database limits have been previously explicitly specified with
pfiXformerLimits or pfiIXformDBLimits they will not be overwritten.
pfiResetXformer causes the motion models, the collision model, and the
current position and transformation matrices to be reset to their initial
state.
Page 4
pfiXformer(3pf) OpenGL Performer 3.2.2 libpfui Reference Pages
pfiStopXformer causes the transformation matrix in xf to stop changing by
zeroing velocity and acceleration.
pfiResetXformerPosition causes the position of the pfiXformer and its
current motion model to be reset to the initial position. This stored
position can be set with pfiXformerResetCoord and queried with
pfiGetXformerResetCoord.
pfiCenterXformer will cause the position of the pfiXformer and its
current motion model to be reset to the center of the database, computed
using the current database limits as defined by pfiXformerNode or
pfiIXformDBLimits.
pfiEnableXformerCollision enables the current requested collisions on xf
which will be computed upon the call to pfiCollideXformer.
pfiDisableXformerCollision disables the requested collision and a call to
pfiCollideXformer will have no effect.
pfiCollideXformer performs collision checks of xf against all relevant
objects (as specified in pfiXformerCollision) and return TRUE if xf has
collided with something. This routine is commonly called from a forked
intersection process.
NOTES
The libpfui source code, object code and documentation are provided as
unsupported software. Routines are subject to change in future releases.
SEE ALSO
pfiTDFXformer, pfChannel, pfChanViewMat, pfCoord, pfDCS,
pfGetSharedArena, pfMatrix
Page 5