pfCylinder(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
NAME
pfMakeEmptyCyl, pfCylAroundSegs, pfCylAroundPts, pfCylAroundBoxes,
pfCylAroundSpheres, pfCylExtendByBox, pfCylExtendBySphere,
pfCylExtendByCyl, pfCylContainsPt, pfCylIsectSeg, pfOrthoXformCyl -
Operations on cylinder definitions.
FUNCTION SPECIFICATION
#include <Performer/pr.h>
void pfMakeEmptyCyl(pfCylinder *cyl);
void pfCylAroundSegs(pfCylinder *dst, const pfSeg **segs, int nseg);
void pfCylAroundPts(pfCylinder *dst, const pfVec3 *pts, int npt);
void pfCylAroundBoxes(pfCylinder *dst, const pfBox **boxes, int nbox);
void pfCylAroundSpheres(pfCylinder *dst, const pfSphere **sphs,
int nsph);
void pfCylExtendByBox(pfCylinder *dst, const pfBox *box);
void pfCylExtendBySphere(pfCylinder *dst, const pfSphere *sph);
void pfCylExtendByCyl(pfCylinder *dst, const pfCylinder *cyl);
int pfCylContainsPt(const pfCylinder* cyl, const pfVec3 pt);
int pfCylIsectSeg(const pfCylinder* cyl, const pfSeg* seg, float* d1,
float* d2);
void pfOrthoXformCyl(pfCylinder *dst, const pfCylinder *cyl,
const pfMatrix xform);
typedef struct
{
pfVec3 center;
float radius;
pfVec3 axis;
float halfLength;
} pfCylinder;
DESCRIPTION
A pfCylinder represents a cylinder of finite length. The routines listed
here provide means of creating and extending cylinders for use as
bounding geometry around groups of line segments. The cylinder is
defined by its center, radius, axis and halfLength. The routines assume
axis is a vector of unit length, otherwise results are undefined.
pfCylinder is a public struct whose data members center, radius, axis and
Page 1
pfCylinder(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
halfLength may be operated on directly.
pfMakeEmptyCyl sets dst so that it appears empty to other operations.
pfCylAroundSegs, pfCylAroundPts, pfCylAroundSpheres and pfCylAroundBoxes
set dst to a cylinder which contains a set of line segments, points,
spheres or boxes, respectively. These routines are passed the address of
an array of pointers to the objects to be encompassed along with the
number of objects.
pfCylExtendByBox, pfCylExtendBySphere, and pfCylExtendByCyl set dst to a
cylinder which contains both the pfSphere dst and the box box, the sphere
sph or the cylinder cyl, respectively.
pfCylContainsPt returns TRUE or FALSE depending on whether the point pt
is in the interior of the specified pfCylinder.
pfCylIsectSeg intersects the line segment seg with the volume of the
cylinder cyl. The possible return values are:
PFIS_FALSE:
seg lies entirely in the exterior.
PFIS_MAYBE | PFIS_TRUE | PFIS_START_IN:
The starting point of seg lies in the interior.
PFIS_MAYBE | PFIS_TRUE | PFIS_END_IN:
The ending point of seg lies in the interior.
PFIS_MAYBE | PFIS_TRUE | PFIS_ALL_IN | PFIS_START_IN | PFIS_END_IN:
Both end points of seg lie in the interior.
If d1 and d2 are non-NULL, on return from pfCylIsectSeg they contain the
starting and ending positions of the line segment (0 <= d1 <= d2 <= seg-
>length) intersected with the cyl.
pfOrthoXformCyl sets dst to the cylinder cyl transformed by the
orthogonal transformation xform. dst = cyl * xform. If xform is not an
orthogonal transformation the results are undefined.
SEE ALSO
pfBox, pfCylinder, pfSeg, pfSphere, pfVec3
Page 2