• Advertisement
  • entries
    88
  • comments
    105
  • views
    70530

vortxGE 2.0 progress

Sign in to follow this  

344 views

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

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement