pfHit(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages pfHit(3pf)NAMEpfHit - Intersection and bounding operations on drawable geometry
FUNCTION SPECIFICATION
#include <Performer/pr/pfGeoSet.h>
int pfHit::query(uint which, void *dst);
int pfHit::mQuery(uint *which, void *dst);
static pfType * pfHit::getClassType(void);
DESCRIPTION
pfHit::query and pfHit::mQuery read out information from the pfHit
object. pfHit::query copies an item from the object into the location
specified by dst. which specifies the item to be copied using one of the
PFHIT_ tokens listed above. pfHit::mQuery copies a series of items
sequentially into the buffer specified by dst. The items and their order
are defined by a NULL-terminated array of query tokens pointed to by
which. For both functions, the return value is the number of bytes
written to the destination buffer.
PFQHIT_FLAGS returns a bit vector indicating the validity of information
in the structure. It is formed by a bitwise OR-ing of the PFHIT_POINT,
PFHIT_NORM, PFHIT_PRIM, PFHIT_TRI, PFHIT_VERTS and PFHIT_XFORM symbols.
Flags Bit Validity
________________________________________________
PFHIT_POINT Point of intersection
PFHIT_NORM Polygon normal
PFHIT_PRIM Index of primitive in pfGeoSet
PFHIT_TRI Index of triangle within primitive
PFHIT_VERTS Triangle vertices
PFHIT_XFORM Non-identity transformation matrix
|
Other queried quantities are valid if non-NULL.
PFQHIT_POINT, PFQHIT_NORM and PFQHIT_SEG query the point of intersection,
the normal of the triangle at that point, and the current segment as
clipped by the intersection process. All are in local coordinates, i.e.
they do not include the transformations of pfSCSes and pfDCSes above them
in the scene graph. When intersecting with primitives inside a pfGeoSet,
PFQHIT_PRIM, PFQHIT_TRI and PFQHIT_VERTS provide the index of the
primitive within the pfGeoSet, the triangle within the primitive, and the
vertices of the intersected triangle, respectively. PFQHIT_GSET returns
the GeoSet. PFQHIT_NODE returns the parent pfGeode.
PFQHIT_PATH returns a pfPath* denoting the traversal path. Like the
pfHit object it is reused and should not be freed.
pfHit::getClassType returns the pfType* for the class pfHit. The pfType*
returned by pfHit::getClassType is the same as the pfType* returned by
Page 1
pfHit(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages pfHit(3pf)
invoking the virtual function getType on any instance of class pfHit.
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 the member function isOfType 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.
SEE ALSO
pfCylinder, pfNode, pfGeoSet, pfObject, pfSeg
Page 2