pfCylinder(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
NAMEpfCylinder - Operations on cylinder definitions.
FUNCTION SPECIFICATION
#include <Performer/pr/pfGeoMath.h>
void* pfCylinder::operator new(size_t);
void* pfCylinder::operator new(size_t, void *arena);
pfCylinder::pfCylinder();
pfCylinder(const pfVec3& _center, float _radius,
const pfVec3& _axis, float _halfLength);
void pfCylinder::makeEmpty(void);
void pfCylinder::around(const pfSeg **segs, int nseg);
void pfCylinder::around(const pfBox **boxes, int nbox);
void pfCylinder::around(const pfVec3 *pts, int npt);
void pfCylinder::around(const pfCylinder **cyls, int ncyl);
void pfCylinder::around(const pfSphere **sphs, int nsph);
void pfCylinder::extendBy(const pfBox *sph);
void pfCylinder::extendBy(const pfSphere *sph);
void pfCylinder::extendBy(const pfCylinder *cyl);
int pfCylinder::contains(const pfVec3 &pt);
int pfCylinder::isect(const pfSeg* seg, float* d1, float* d2);
void pfCylinder::orthoXform(const pfCylinder *cyl,
const pfMatrix &xform);
struct pfCylinder
{
pfVec3 center;
float radius;
pfVec3 axis;
float halfLength;
};
Page 1
pfCylinder(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
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
halfLength may be operated on directly.
The default constructor pfCylinder() is empty and does no initialization.
There is also a constructor that will do direct initialization of the
pfCylinder's center, radius, axis, and half length. new(arena) allocates
a pfCylinder from the specified memory arena, or from the heap if arena
is NULL. new allocates a pfCylinder from the default memory arena (see
pfGetSharedArena). pfCylinders can also be created automatically
automatically on the stack or statically. pfCylinders allocated with new
can be deleted with delete or pfDelete.
pfCylinder::makeEmpty sets the pfCylinder so that it appears empty to
other operations.
pfCylinder::around(const pfSeg**, int), pfCylinder::around(const pfVec3*,
int), pfSphere::around(const pfSphere**, int) and
pfCylinder::around(const pfBox**, int) set the pfCylinder 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.
pfCylinder::extendBy(const pfBox *), pfCylinder::extendBy(const pfSphere
*), and pfCylinder::extendBy(const pfCylinder *) set the pfCylinder to a
cylinder which contains both the pfSphere and the box box, the sphere
sph or the cylinder cyl, respectively.
pfCylinder::contains returns TRUE or FALSE depending on whether the point
pt is in the interior of the specified pfCylinder.
pfCylinder::isect 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.
Page 2
pfCylinder(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
If d1 and d2 are non-NULL, on return from pfCylinder::isect they contain
the starting and ending positions of the line segment (0 <= d1 <= d2 <=
seg->length) intersected with the cyl.
pfCylinder::orthoXform sets the pfCylinder to the cylinder cyl
transformed by the orthogonal transformation xform. the pfCylinder = cyl
* xform. If xform is not an orthogonal transformation the results are
undefined.
NOTES
C++ does not support array deletion (i.e. delete[]) for arrays of objects
allocated new operators that take additional arguments. Hence, the array
deletion operator delete[] should not be used on arrays of objects
created with new(arena) pfVec3[n].
SEE ALSO
pfBox, pfCylinder, pfSeg, pfSphere, pfVec3
Page 3