Re: allocation of pfDCS

New Message Reply Date view Thread view Subject view Author view

From: Brian Furtaw (brian++at++sgi.com)
Date: 01/10/2000 10:10:54


Anthony,

Anthony Bavuso wrote:
>
> I have a question regarding the allocation of a pfDCS object.
> For the performer man page on pfDCS's it states:
> new pfDCS creates and returns a handle to a pfDCS. Like other pfNodes,
> pfDCSes are always allocated from shared memory and cannot be created
> statically, on the stack or in arrays. pfDCSes should be deleted using
> pfDelete rather than the delete operator.
>
> Can someone explain to me why pfNodes must "always be allocated from shared
> memory and cannot be created statically"?

PfNodes must be built from shared memory so that there components can be
accessed and updated by other processes most notably CULL and DRAW.

>
> I can short of understand why a pfNode that is used in the scene graph needs
> to be in shared memory so that the CULL and DRAW processes can get to the
> node.
>
> But what I want is a static pfDCS object that my thread alters
> asynchronously and then at one time, copy my thread's static pfDCS node into
> a local pfDCS node that is allocated from shared memory using new and then
> insert the copy into the scene graph.

Have you tried using a pfMatrix class instance it contains most
everything you would want from a pfDCS to describe the motion of an
object. You can still get information from the pfDCS node and just
change the pfMatrix. Then use the modified pfMatrix to update the pfDCS
in the APP process.

Use the pfCoord class to record your position and heading. The pfCoord
class is made up of two pfVec3's.

All the components mentioned above can be static.

>
> But I have found that if I try to allocate a pfDCS statically the program
> core dumps.

This is because the address of the pfDCS is being passed in between the
APP, CULL and DRAW processes and if you allocated it statically it only
exists in the address space of the APP process.

Brian

>
> Thanks for your help.
>
> Anthony Bavuso
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
    ----oOOo----    ----oOOo----    ----oOOo----    ----oOOo----

Brian Furtaw (brian++at++sgi.com) Graphics Guru Office:(301)572-3293 Fax: (301)572-3280 12200-G Plum Orchard Drive OpenGL/Performer/OpenInventor/ImageVision Silver Spring, Maryland 20904 Optimizer/React/PCI Device Drivers


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Jan 10 2000 - 10:27:26 PST

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