Re: pfGetUserData in forked ISECT proc

New Message Reply Date view Thread view Subject view Author view

Rick Weyrauch (rweyrauch++at++camus.paradigmsim.com)
Fri, 16 Aug 1996 16:10:47 -0500


Peter,

This is a bug in Performer 2.1 and 2.0.2 where user data attached to a pfNode
is
not copied to the ISECT process. There is a workaround for this problem
(thanks to Jenny Zhao at SGI).

The fix is to call pfFrame prior to attaching your user data or you can (from
the APP process) traverse your scene graph and reattach your user data before
starting your sim-loop. The following code snippet fixes the problem....

void fixUserData(pfNode *node)
{
    void *ud = NULL;
    int numKids = 0;
    int i;

    if (node == NULL) return;

    ud = pfGetUserData(node);
    if (ud) pfUserData(node, ud);

    if (pfIsOfType(node, pfGetGroupClassType())) {
         numKids = pfGetNumChildren(node);
         for (i=0; i<numKids; i++)
             fixUserData(pfGetChild(node, i));
    }
}

main()
{
   ...
   pfScene *scene = LoadScene();

   pfFrame();

   fixUserData((pfNode *)scene);

   while (1) {
        ...
   }
}

Rick

-- 

Rick Weyrauch voice: (214) 960-2301 Paradigm Simulation Inc. fax: (214) 960-2303 14900 Landmark Blvd., Suite 400 rweyrauch++at++paradigmsim.com Dallas TX 75240 www.paradigmsim.com ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:22 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.