Andrew Bailey (andrew++at++csunb0.leeds.ac.uk)
Mon, 07 Jun 1999 14:51:02 +0000
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
This archive was generated by hypermail 2.0b2 on Mon Jun 07 1999 - 06:52:49 PDT