Jump to content

  • Log In with Google      Sign In   
  • Create Account





- - - - -

vortxGE 2.0 progress

Posted by , 30 January 2012 · 259 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 );









Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

September 2016 »

S M T W T F S
    123
45678910
11121314151617
18192021222324
252627 28 2930 

Recent Comments

PARTNERS