pfPolytope(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
NAME
pfNewPtope, pfGetPtopeClassType, pfGetPtopeNumFacets, pfPtopeFacet,
pfGetPtopeFacet, pfRemovePtopeFacet, pfOrthoXformPtope,
pfPtopeContainsPt, pfPtopeContainsSphere, pfPtopeContainsBox,
pfPtopeContainsCyl, pfPtopeContainsPtope - Create, configure, transform,
and intersect polytopes
FUNCTION SPECIFICATION
#include <Performer/pr.h>
pfPolytope* pfNewPtope(void *arena);
pfType* pfGetPtopeClassType(void);
int pfGetPtopeNumFacets(pfPolytope *ptope);
int pfPtopeFacet(pfPolytope *ptope, int i,
const pfPlane *facet);
int pfGetPtopeFacet(pfPolytope *ptope, int i, pfPlane *facet);
int pfRemovePtopeFacet(pfPolytope *ptope, int i);
void pfOrthoXformPtope(pfPolytope *ptope, const pfPolytope *src,
const pfMatrix mat);
int pfPtopeContainsPt(const pfPolytope *ptope,
const pfVec3 pt);
int pfPtopeContainsSphere(const pfPolytope *ptope,
const pfSphere *sphere);
int pfPtopeContainsBox(const pfPolytope *ptope,
const pfBox *box);
int pfPtopeContainsCyl(const pfPolytope *ptope,
const pfCylinder *cyl);
int pfPtopeContainsPtope(const pfPolytope *ptope,
const pfPolytope *ptope1);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfPolytope is derived from the parent class
pfObject, so each of these member functions of class pfObject are also
directly usable with objects of class pfPolytope. Casting an object of
class pfPolytope to an object of class pfObject is taken care of
automatically. This is also true for casts to objects of ancestor
classes of class pfObject.
void pfUserDataSlot(pfObject *obj, int slot, void *data);
Page 1
pfPolytope(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
void pfUserData(pfObject *obj, void *data);
void* pfGetUserDataSlot(pfObject *obj, int slot);
void* pfGetUserData(pfObject *obj);
int pfGetNumUserData(pfObject *obj);
int pfGetNamedUserDataSlot(const char *name);
const char* pfGetUserDataSlotName(int slot);
int pfGetNumNamedUserDataSlots(void);
int pfGetGLHandle(pfObject *obj);
int pfDeleteGLHandle(pfObject *obj);
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfPolytope can also be used with these
functions designed for objects of class pfMemory.
pfType * pfGetType(const void *ptr);
int pfIsOfType(const void *ptr, pfType *type);
int pfIsExactType(const void *ptr, pfType *type);
const char * pfGetTypeName(const void *ptr);
int pfRef(void *ptr);
int pfUnref(void *ptr);
int pfUnrefDelete(void *ptr);
int pfUnrefGetRef(void *ptr);
int pfGetRef(const void *ptr);
int pfCopy(void *dst, void *src);
int pfDelete(void *ptr);
int pfIsFluxed(void *ptr);
int pfCompare(const void *ptr1, const void *ptr2);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
PARAMETERS
ptope identifies a pfPolytope
DESCRIPTION
A pfPolytope is a set of half spaces whose intersection defines a convex,
possibly semi-infinite, volume which may be used for culling and other
intersection testing where a tighter bound than a pfBox, pfSphere, or
pfCylinder is of benefit.
pfNewPtope creates and returns a handle to a pfPolytope. arena specifies
a malloc arena out of which the pfPolytope is allocated or NULL for
allocation off the process heap.
pfGetPtopeClassType returns the pfType* for the class pfPolytope. The
pfType* returned by pfGetPtopeClassType is the same as the pfType*
returned by invoking pfGetType on any instance of class pfPolytope.
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.
Page 2
pfPolytope(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
pfPtopeFacet sets the ith facet of ptope to facet. facet defines a half
space such that the normal of the pfPlane faces "outside".
pfGetPtopeFacet copies the ith facet of ptope into facet.
pfRemovePtopeFacet removes the ith facet of ptope from the list.
Remaining facets are shifted left over the removed facet.
pfGetPtopeNumFacets returns the number of facets in ptope.
pfOrthoXformPtope transforms src by mat and places the result in ptope.
mat should be an orthonormal matrix or results are undefined.
The pfPtopeContains<*> routines compute the intersection of ptope with a
variety of geometric primitives. pfPtopeContains<*> returns one of the
following:
PFIS_FALSE:
The intersection of the primitive and the pfPolytope is empty.
PFIS_MAYBE:
The intersection of the primitive and the pfPolytope might be
non-empty.
PFIS_MAYBE | PFIS_TRUE:
The intersection of the primitive and the pfPolytope is
definitely non-empty.
PFIS_MAYBE | PFIS_TRUE | PFIS_ALL_IN:
The primitive is non-empty and lies entirely inside the
pfPolytope.
SEE ALSO
pfBox, pfCylinder, pfDelete, pfFrustum, pfMatrix, pfObject, pfSphere
Page 3