pfLightPoint(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
NAMEpfLightPoint - Set and get pfLightPoint size, color, shape, rotation and
position.
FUNCTION SPECIFICATION
#include <Performer/pf/pfLightPoint.h>
pfLightPoint::pfLightPoint(int num);
static pfType * pfLightPoint::getClassType(void);
int pfLightPoint::getNumPoints(void);
void pfLightPoint::setSize(float size);
float pfLightPoint::getSize(void);
void pfLightPoint::setColor(int index, pfVec4 &clr);
void pfLightPoint::getColor(int index, pfVec4 &clr);
void pfLightPoint::setRot(float azim, float elev,
float roll);
void pfLightPoint::getRot(float *azim, float *elev,
float *roll);
void pfLightPoint::setShape(int dir, float henv, float venv,
float falloff);
void pfLightPoint::getShape(int *dir, float *henv,
float *venv, float *falloff);
void pfLightPoint::setFogScale(float onsetScale,
float opaqueScale);
void pfLightPoint::getFogScale(float *onsetScale,
float *opaqueScale);
void pfLightPoint::setPos(int index, pfVec3 &pos);
void pfLightPoint::getPos(int index, pfVec3 &pos);
pfGeoSet* pfLightPoint::getGSet(void);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfLightPoint is derived from the parent class
pfNode, so each of these member functions of class pfNode are also
directly usable with objects of class pfLightPoint. This is also true
for ancestor classes of class pfNode.
Page 1
pfLightPoint(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
pfGroup * pfNode::getParent(int i);
int pfNode::getNumParents(void);
void pfNode::setBound(pfSphere *bsph, int mode);
int pfNode::getBound(pfSphere *bsph);
pfNode* pfNode::clone(int mode);
pfNode* pfNode::bufferClone(int mode, pfBuffer *buf);
int pfNode::flatten(int mode);
int pfNode::setName(const char *name);
const char * pfNode::getName(void);
pfNode* pfNode::find(const char *pathName, pfType *type);
pfNode* pfNode::lookup(const char *name, pfType* type);
int pfNode::isect(pfSegSet *segSet, pfHit **hits[]);
void pfNode::setTravMask(int which, uint mask, int setMode,
int bitOp);
uint pfNode::getTravMask(int which);
void pfNode::setTravFuncs(int which, pfNodeTravFuncType pre,
pfNodeTravFuncType post);
void pfNode::getTravFuncs(int which, pfNodeTravFuncType *pre,
pfNodeTravFuncType *post);
void pfNode::setTravData(int which, void *data);
void * pfNode::getTravData(int which);
void pfNode::setTravMode(int which, int mode, int val);
int pfNode::getTravMode(int which, int mode) const;
Since the class pfNode is itself derived from the parent class pfObject,
objects of class pfLightPoint can also be used with these functions
designed for objects of class pfObject.
void* pfObject::operator new(size_t);
void* pfObject::operator new(size_t, pfFluxMemory *fmem);
void pfObject::setUserData(void *data);
void pfObject::setUserData(int slot, void *data);
void* pfObject::getUserData(pfObject *obj);
void* pfObject::getUserData(pfObject *obj, int slot);
int pfObject::getNumUserData();
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfLightPoint can also be used with these
functions designed for objects of class pfMemory.
void* pfMemory::getData(const void *ptr);
pfType * pfMemory::getType();
int pfMemory::isOfType(pfType *type);
int pfMemory::isExactType(pfType *type);
const char * pfMemory::getTypeName();
int pfMemory::copy(pfMemory *src);
int pfMemory::compare(const pfMemory *mem);
void pfMemory::print(uint which, uint verbose, char *prefix,
FILE *file);
Page 2
pfLightPoint(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
int pfMemory::getArena(void *ptr);
void* pfMemory::getArena();
int pfMemory::ref();
int pfMemory::unref();
int pfMemory::unrefDelete();
int pfMemory::unrefGetRef();
int pfMemory::getRef();
int pfMemory::checkDelete();
int pfMemory::isFluxed();
void * pfMemory::getArena();
int pfMemory::getSize();
DESCRIPTIONpfLightPoint is now obsoleted in favor of the libpr primitive
pfLPointState. pfLightPoint::getGSet returns the underlying pfGeoSet from
which the pfLPointState can be found:
gset = lpoint->getGSet();
gstate = gset->getGState();
lpstate = gstate->getAttr(PFSTATE_LPOINTSTATE);
A pfLightPoint is a pfNode that contains one or more light points. The
light point node is quite different from a pfLightSource; it is visible
as one or more self-illuminated small points but these points do not
illuminate surrounding objects. In contrast to this, a pfLightSource does
illuminate scene contents but is itself not a visible object. All the
light points in a pfLightPoint node share all their attributes except
point location and color.
new pfLightPoint creates and returns a handle to a pfLightPoint. Like
other pfNodes, pfLightPoints are always allocated from shared memory and
cannot be created statically, on the stack or in arrays. pfLightPoints
should be deleted using pfDelete rather than the delete operator. num
specifies the maximum number of individual light points the node may
contain. The function pfLightPoint::getNumPoints returns this maximum
number of light points that the pfLightPoint node can hold. This is the
value set when the light point node was created using new pfLightPoint
and is the size of the internal position and color arrays used to
represent the light points.
pfLightPoint::getClassType returns the pfType* for the class
pfLightPoint. The pfType* returned by pfLightPoint::getClassType is the
same as the pfType* returned by invoking the virtual function getType on
any instance of class pfLightPoint. 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.
Page 3
pfLightPoint(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
pfLightPoint::setSize sets the screen size of each point of light in the
pfLightPoint. size is specified in pixels and is used as the argument to
pntsizef. Whenever possible, antialiased points are used but the actual
representation of a light point depends on the hardware being used. See
the pntsizef man page for a description of available light point sizes on
OpenGL hardware. pfLightPoint::getSize returns the size of the
pfLightPoint.
pfLightPoint::setColor sets the color of light point index in the
pfLightPoint to clr. The actual color displayed depends on light point
direction, shape, position, and fog. clr specifies red, green, blue and
alpha in the range 0.0 to 1.0. A pfLightPoint is turned off with an
alpha of 0.0 since it will be rendered as completely transparent.
pfLightPoint::getColor copies the indexth color into clr.
pfLightPoint::setRot is used for directional lights. The direction of
all light points in the pfLightPoint is the positive Y axis, rotated
about the X axis by elev then rotated about the Z axis by azim. roll
only affects the light envelope as described below. The direction vector
is rotated by any transformations (see pfSCS, pfDCS) above the
pfLightPoint in the hierarchy.
pfLightPoint::getRot copies the pfLightPoint's rotation into azim, elev,
and roll.
pfLightPoint::setShape describes the intensity distribution of a light
point about its direction vector. dir is a symbolic token:
PFLP_OMNIDIRECTIONAL
the pfLightPoint will be drawn as omnidirectional light points.
Light distribution is equal in all directions. All other
arguments are ignored.
PFLP_UNIDIRECTIONAL
the pfLightPoint will be drawn as unidirectional point lights.
Light distribution is an elliptical cone centered about the
light direction vector.
PFLP_BIDIRECTIONAL
the pfLightPoint will be drawn as bidirectional light points.
Light distribution is two elliptical cones centered about the
positive and negative light direction vectors.
henv and venv are total angles (not half-angles) in degrees which specify
the horizontal and vertical envelopes about the direction vector. An
envelope is a symmetric angular spread in a specific plane about the
light direction vector. The default direction is along the positive Y
axis so the horizontal envelope is in the X plane and the vertical in the
Z plane. Both direction and envelopes are rotated by the
pfLightPoint::setRot and any inherited transformations. The default
envelope angles are 360.0 degrees which is equivalent to an
omnidirectional light.
Page 4
pfLightPoint(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
When the vector from the eyepoint to the light position is outside a
light's envelope, the light point is not displayed. If within, the
intensity of the light point is computed based on the location of the eye
within the elliptical cone. Intensity ranges from 1.0 when the eye lies
on the light direction vector to 0.0 on the edge of the cone. falloff is
an exponent which modifies the intensity. A value of 0 indicates that
there is no falloff and values > 0 increase the falloff rate. The
default falloff is 4. As intensity decreases, the light point's
transparency increases.
pfLightPoint::getShape copies the pfLightPoint's shape parameters into
dir, henv, venv, and falloff.
In general, the real world intensity of emissive light points is much
greater than that of reflective surfaces. Consequently, when fog is
active, light points should be more visible through the fog.
pfLightPoint::setFogScale sets the fog range scale factors that affects
all light points in the pfLightPoint. onsetScale and opaqueScale
multiply the onset and opaque ranges (pfFog::setRange) of the currently
active fog. Thus if the scale factors are greater than 1.0, the light
points will be more visible through fog than reflective surfaces. The
default fog scale factors are both 4.0. pfLightPoint::getFogScale copies
the fog scale factors of the pfLightPoint into onsetScale and
opaqueScale.
pfLightPoint::setPos sets the position of light point with index index to
pos. index is clamped to the range [0, num-1]. All positions are
transformed by any inherited transformations. The final position and
orientation of a light point i is transformed by R * T[index] * M where R
is a rotation matrix defined by pfLightPoint::setRot, T[i] is the
position of light point i, and M is the transformation inherited by the
pfLightPoint from its hierarchy.
pfLightPoint::getPos copies the indexth position into pos.
NOTES
Light point processing in OpenGL Performer has been subsumed by the new
pfLPointState mechanism, which is both more powerful and more efficient.
Application developers are encouraged to transition to these new light
point facilities.
pfLightPoint nodes, unlike pfLPointState GeoSets, do not provide size or
intensity modulation based on distance to the viewer and the viewport
size. Also, directional lights are significantly more expensive to cull
than omnidirectional lights.
Falloff distribution is cosine(incidence angle) ^ falloff.
When sorting is enabled (see pfChannel::setTravMode and PFCULL_SORT),
light points are drawn after opaque geometry unless the pfLightPoint node
has a pre-draw or post-draw callback (see pfNode::setTravFuncs).
Page 5
pfLightPoint(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
SEE ALSO
pfNode, pfLPointState
Page 6