🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

vortxGE 2.0 progress

Published January 31, 2012
Advertisement
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...

// ********************
// 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 );

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

vortxGE : Threads

2452 views

C++11 Threads

3150 views

My Business

2305 views

Still Alive

2116 views

vortxEDIT : video

2236 views

vortxGE : Update

6078 views

vortxEDIT : Save

1995 views
Advertisement