Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

irrlicht animation issue

By: a guest on Nov 10th, 2012  |  syntax: C++  |  size: 0.74 KB  |  views: 93  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <irrlicht.h>
  2.  
  3. //namespaces
  4.  
  5. //check for windows pragma (developed on linux)
  6.  
  7. int main()
  8. {
  9.         //create device
  10.         IAnimatedMesh* mesh = smgr->getMesh("./test.b3d");//smgr is the scene manager
  11.         if(!mesh)
  12.         {
  13.                 device->drop();
  14.                 return 1;
  15.         }
  16.         node = smgr->addAnimatedMeshSceneNode(mesh);
  17.         if(node)
  18.         {
  19.                 node->setFrameLoop(0,45);
  20.                 node->setCurrentFrame(0.f);
  21.                 node->setAnimationSpeed(90.0f);
  22.                 node->setMaterialFlag(EMF_LIGHTING, false);
  23.                 node->setJointMode(EJUOR_CONTROL);
  24.         }
  25.         //make camera...
  26.  
  27.         while(device->run())
  28.         {
  29.                 driver->beginScene(true,true,SColor(255,100,101,140));
  30.                
  31.                 node->animateJoints();
  32.  
  33.                 smgr->drawAll();
  34.                 guienv->drawAll();//gui
  35.  
  36.  
  37.                 driver->endScene();
  38.         }
  39.  
  40.         device->drop();
  41.         return 0;
  42. }
clone this paste RAW Paste Data