pfNode::lookup problem and pfClone

New Message Reply Date view Thread view Subject view Author view

Andrew Bailey (andrew++at++csunb0.leeds.ac.uk)
Mon, 07 Jun 1999 14:51:02 +0000


Hi,

Can anyone shed any light on why pfNode::lookup works at one point and
not the other in the following code? It successfully finds the "Wheels"
group the first time lookup is called but not the second time.

pfGroup *wheels = (pfGroup *) carModel->lookup("Wheels",
pfGroup::getClassType());

pfNode *clone;
   if ((clone = carModel->clone(0)) != NULL) ourDCS->addChild(clone);
   scene->addChild(ourDCS);

wheels = (pfGroup *) carModel->lookup("Wheels",
pfGroup::getClassType());

Basically, what I want to do is add a pfDCS node above the "Wheels"
group, so I can move them independantly of the rest of the car (moved by
altering "ourDCS").

Also, I have a pfSwitch as part of the orignal roverModel geometry, and
I know the switch state does not get cloned, so if I needed to access
the switch of the clone can I just use clone->lookup to find the switch
and alter its value?

I ask this because if I write
wheels = (pfGroup *) clone->lookup("Wheels", pfGroup::getClassType());
after I clone the carModel this also returns NULL.

thanks,
Andrew


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Jun 07 1999 - 06:52:49 PDT

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