Nicolas Gauvin (nicolas++at++cae.ca)
Wed, 22 Jan 1997 10:54:59 -0500
You shouldn't need to call pfGSetAttr again to put the list back.
pfGetGSetAttrLists gives you the pointers to the actual list, not a copy of
them. Once you have the pointer, simply modify its content and thats it. The
geoset will be aware of the changes.
However the safest way to do this sort of thing is to use a pfCycleBuffer
for the attribute list you intend to modify. This way you will be frame
accurate when multiprocessing.
The man page of pfCycleBuffer contains a simple example for this:
pfVec3 *prevVerts, *curVerts;
pfInit();
pfMultiprocess(mpMode);
/*
* This calls pfCBufferConfig() with the number of buffers
* appropriate to the multiprocessing mode.
*/
pfConfig();
verts = pfNewCBuffer(sizeof(pfVec3) * numVerts, pfGetSharedArena());
pfGSetAttr(gset, PFGS_COORD3, PFGS_PER_VERTEX, verts, NULL);
while(!done)
{
curVerts = pfGetCurCBufferData(verts);
/* Compute new positions of mass-spring system */
for (i=0; i<numVerts; i++)
curVerts[i] = prevVerts[i] + netForceVector * deltaTime;
/* Indicate that 'verts' has changed */
pfCBufferChanged(verts);
prevVerts = curVerts;
/* This calls pfCBufferFrame() */
pfFrame();
}
--
Nicolas Gauvin CAE Electronics Ltd., 8585 Cote De Liesse
Software Developer Saint-Laurent, Quebec, Canada, H4L-4X4
3-D Graphics Applications tel: +1 514 341 2000 extension 2275
nicolas++at++cae.ca fax: +1 514 340 5496
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:25 PDT