Basic animation system all done and working nicely. Now on to skeleton animation. hmmm
Some example code from my test app showing a basic setup of keys etc...
Some example code from my test app showing a basic setup of keys etc...
// ******************** // Testing lsAnimationManager *am; lsActor *actor = new lsActor( demo_scene ); actor->Init(); actor->setName( "Actor Test" ); am = actor->getAnimation_manager(); actor->debug_batch = batch; demo_scene->Add_Node( actor ); // anim lsVector3 pos; lsVector3 rot; lsVector3 sca; // we need 4 keys to produce a curve // position pos = lsVector3( 0, 1.5, 0 ); am->InsertKey_Pos( 0, pos ); am->InsertKey_Pos( 1, pos ); pos = lsVector3( 10, 1.5, 0 ); am->InsertKey_Pos( 150, pos ); pos = lsVector3( 0, 1.5, 5 ); am->InsertKey_Pos( 300, pos ); pos = lsVector3( 0, 1.5, 0 ); am->InsertKey_Pos( 499, pos ); am->InsertKey_Pos( 500, pos ); // rotation rot = lsVector3( 0, 0, 0 ); am->InsertKey_Rot( 0, rot ); am->InsertKey_Rot( 1, rot ); rot = lsVector3( -6000, -4000, -2000 ); am->InsertKey_Rot( 250, rot ); rot = lsVector3( 6000, 4000, 2000 ); am->InsertKey_Rot( 499, rot ); am->InsertKey_Rot( 500, rot ); // scale - just make sure scale is 1,1,1 sca = lsVector3( 1.0, 1.0, 1.0 ); am->InsertKey_Scale( 1, sca ); am->setFramerate( 60.0 ); am->Play( -5, 500, true );
Create a custom theme




