Re: Question: pfGetGSetAttrLists()

New Message Reply Date view Thread view Subject view Author view

Ran Yakir (rany++at++rtset.co.il)
Wed, 8 Jan 1997 01:50:53 -0800


Jack,

You don't seem to be checking for a type of geode in the updateLsd function.
What if the children of the CIC group are themselves groups and not geodes ? In
that case you might get a pointer to an object which is not a geoset at all.
Trying to access this geoset with geoset functions will do the job of core
dumping.

Ran

On Jan 7, 11:09am, John Kapp wrote:
>
> The Problem: A stand alone program was written and this code worked fine.
However,
> the actual code has been inserted into a large networked battlefield
simulation
> program. Now the pfGetGSetAttrLists() (line 30) causes a segmentation fault,
as does
> any use of pfGeoSet functions (ie pfGetGSetAttrBind() or
pfGetGSetAttrRange())
> through the geo that was returned in line 18.
>
> Any ideas why?
>
> Our limited experience leads us to guess that there must be some
> attempt to access an area of memory that is preventing the
pfGetGSetAttrLists().
>
> Is this the right way to go about retrieving coordinates of geometry? Our
goal is
> to overlay other geometry on that retrieved. We accomplished that in a stand
alone
> and thought, much to our naivete, that we would just cut and paste.
>
>
> Thanks in Advance,
>
> Jack Kapp
> Erkan Akyuz
>
> #######################################################################
>
> 1 void updateLsd(pfGroup* shipRoot) {
> 2
> 3 pfNode *monitor, *object;
> 4 pfGroup *cic;
> 5 pfGeode *lsd;
> 6 pfGeoSet *geo;
> 7
> 8 //Find CIC in ship model
> 9 object = pfFindNode(shipRoot, "CIC", pfGetGroupClassType());
> 10
> 11 //cast object to pfGroup and assign to cic
> 12 cic=(pfGroup*)object;
> 13
> 14 // LSD's are children numbered 31 32 33 34
> 15 for(int i=31; i<=34; i++){
> 16 monitor = pfGetChild(cic, i);
> 17 lsd = (pfGeode*)monitor;
> 18 geo = pfGetGSet(lsd, 0);
> 19 setupLsd(geo);
> 20 }
> 21
> 22 return;
> 23 }
> 24
> 25 void setupLsd(pfGeoSet* geo){
> 26
> 27 pfVec3 *coords;
> 28 ushort *icoords;
> 29
> 30 pfGetGSetAttrLists(geo, PFGS_COORD3, (void**)&coords, &icoords);
>

-- 
 __                                  | Ran Yakir
 /_)  _  __   \  / _   / o __        | RT-SET Ltd.
/ )_ (_(_) )   \/ (_(_/<_(_)(        | 
              _/                     |   
-------------------------------------+--------------------------------
Phone :                              | E-mail : rany++at++rtset.co.il
  Work : 972-9-9552236               |          rany++at++netvision.net.il
  Res. : 972-9-7489974               |
Fax    : 972-9-9552239               |
=======================================================================
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:54:17 PDT

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