Re: [Plib-users] TweenController in plib
Brought to you by:
sjbaker
|
From: Steve B. <sjb...@ai...> - 2002-07-13 00:04:36
|
Rolf Jakob wrote:
> So, you only have a ssgTweenController.
That's what ExPoser puts at the top of the scene sub-graph it
generates...so that's what you'll get back from ssgLoad.
> I tried again and removed the ssgTransform, so that I have :
>
> ssgTweenController *femme_obj;
> femme_obj=new ssgTweenController;
> femme_obj->addKid(ssgLoadSSG("player-female_tweened.ssg"));
> scene->addKid(femme_obj);
>
> float bank=(frameno%140)/14.0;
> femme_obj->selectBank(bank);
> cerr << femme_obj->getTypeName() << " bank : " << bank << endl;
>
> It's an ssgTweenController now, but it won't move. *sigh*
Well, you can certainly put the ssgTweenController *under* an ssgTransform.
Your original code seemed to do that OK:
> > ssgTransform *femme=0;
> > ssgEntity *femme_obj;
> >
> > // init
> > femme=new ssgTransform;
> > femme_obj=ssgLoadSSG("player-female_tweened.ssg");
> > femme->addKid(femme_obj);
> > sgCoord fc;
> > sgSetCoord(&fc,1.67,0.126,0,90,0,0);
> > femme->setTransform(&fc);
> > scene->addKid(femme);
So femme_obj is the ssgTweenController and femme is the transform.
Diagramatically, you had:
scene (ssgRoot)
|
femme (ssgTransform)
|
femme_obj (ssgTweenController)
|
...other stuff...
...which seems OK - I don't understand how come it's not working.
> Before your reply I checked another thing: I used to have a ssgEntity casted
> to a ssgTweenController when needed.
That's OK.
> I turned it around so that I have a
> ssgTweenController and the result of ssgLoadSSG is casted once. That showed
> the exact same result.
Indeed - that's what you'd expect.
>>..so I think you are basically doing the right thing - you must have
>>a bug somewhere. I guess you should do:
>>
>> cerr << femme->getTypeName() << endl ;
>
> femme is a ssgTransform, femme_obj was a ssgRoot in my first example.
Eh? No - 'scene' is the root, femme is the transform and femme_obj is the
ssgTweenController.
Er - right. Sorry, I meant to suggest:
cerr << femme_obj->getTypeName() << endl ;
^^^^
So we can be sure that ExPoser actually *did* write out what we expected
it to.
> With the modifications above (no ssgTransform) a femme_obj->print() reads:
> Current Bank = 0.000000
> ssgTweenController: Name=NoName
> Userdata = (nil)
> Num Parents=0
EH? No parents?!? That suggests that it's not connected into the scene graph.
> Hmmm, I'm supposed to use the file exposer writes directly without any further
> modifications, right ?
Yes - although if you had a 3D modeller (PrettyPoly for example) that understood
SSG-format files - then you *could* go and hand-edit what ExPoser generated.
> PS: I put the current snapshot of the program and everything needed on my
> home page, just in case somebody is interested in it and wants to take a look
> at it. It's a beginning of a OLRPG with server and client, multiple scenes
> and hopefully some walking characters - somewhen ;-)
Perhaps a simpler test program is needed?
----------------------------- Steve Baker -------------------------------
Mail : <sjb...@ai...> WorkMail: <sj...@li...>
URLs : http://www.sjbaker.org
http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
http://prettypoly.sf.net http://freeglut.sf.net
http://toobular.sf.net http://lodestone.sf.net
|