Re: info-performer Feb 21 1999

New Message Reply Date view Thread view Subject view Author view

Scott Herod (herod++at++aspen.evt.com)
Mon, 22 Feb 1999 15:38:03 -0700


Larry Ramey
>
> pfPeople->hello()
>
> so imagine I am trying to turn nodes on and off. (actually it is a
> light, but that is a node)
>
> I am going to use
> pfLightSource* _light = new pfLightSource;
>
> _light->setTravMask(PFTRAV_CULL,?????,PF_SET);
>
> I don't know what goes in ????????
>
> 0x0 for off
> and
> 0xf for on

For exactly the same thing, I use

// turn light off
if ( child->isOfType( pfLightSource::getClassType() ) ) {
   child->setTravMask( PFTRAV_DRAW, 0, PFTRAV_SELF, PF_SET );
}

and

// turn light on
if ( child->isOfType( pfLightSource::getClassType() ) ) {
   child->setTravMask( PFTRAV_DRAW, 0xffffffff, PFTRAV_SELF, PF_SET );
}

>
> PS- has anyone else had problems with useing new for objects like
> pfVec4??? It doesn't seem to agree with the documentation, if I don't
> specify a memory area.....
>
> pfVec3* larry = new pfVec3;
>
> seems to be local (non shared) memory. If I use pfMalloc
> (getSharedArena()) all the problems go away..... This is _NOT_ how the
> man pages describe it working.

I've noticed exactly the same thing when I sat down and
watched memory usage. To be specific, I was losing some
number of bytes when I made geoset colors using new.
I always now use

pfVec3* spam = (pfVec3*) pfMalloc( size, pfGetSharedArena() );

even if I only want one pfVec3.

Scott Herod
scott++at++evt.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Feb 22 1999 - 14:38:09 PST

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