[Plib-users] TweenController in plib
Brought to you by:
sjbaker
|
From: <Rol...@t-...> - 2002-07-09 17:35:40
|
Hi,
I try to get a tween controller to work with the current CVS snapshot. What I
did :
Used exposer to have some animation and saved a tweened model with a bank
every second.
Load the model using ssgLoadSSG resulting to a hierarchy starting with an
ssgEntity. In fact this should be a ssgTweenController.
Create a ssgTransform and add the tween controller as a kid to be able to
transform the model in the scene.
Use the ssgTransform for transformation and the ssgTweenController for the
animation (this one has to be casted from ssgEntity).
The animation has the default length of 10 seconds, so I should have 10 banks.
The problem is I cannot see the model moving, it's always in its first
position. A debug shows that the bank selecting factor travels from 0.0 to
somewhere near 10 and restarts at 0.0, so that should be ok.
I'm quite sure I miss something very simple, but what ?
Is the way I got the model into the scene the way it should be ? Is the type
of the root node preserved from exposer through a ssgLoadSSG() ?
Code sniplets:
// global
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);
// redraw
float bank=(frameno%140)/14.0;
((ssgTweenController *)femme_obj)->selectBank(bank);
cerr << "bank : " << bank << endl;
Thanks,
Rolf
--
Rolf Jakob at home (rj...@du...)
WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS)
|