Code: Select all
#include <iostream>
#include <windows.h>
#include <irrlicht.h>
#pragma comment(lib, "Irrlicht.lib")
using namespace irr;
using namespace scene;
using namespace video;
using namespace core;
IrrlichtDevice* device;
ISceneManager* smgr;
IVideoDriver* driver;
ICameraSceneNode* camera;
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
wchar_t wcap[256];
int screenw = 1024;
int screenh = 768;
device = createDevice( EDT_DIRECT3D9 , dimension2d<s32>(screenw, screenh) , 32 , false , false );
if (device == 0) return 1;
driver = device->getVideoDriver();
smgr = device->getSceneManager();
device->getCursorControl()->setVisible(false);
// Main
camera = smgr->addCameraSceneNodeFPS(0);
camera->setPosition( vector3df(0,0,300) );
IAnimatedMeshSceneNode * node = smgr->addAnimatedMeshSceneNode( smgr->getMesh(".\\data\\test.ms3d") );
node->setPosition( vector3df(50,50,0) );
// THERE IS SKELETON ONLY ON THE MESH!
node->setDebugDataVisible(E_DEBUG_SCENE_TYPE::EDS_FULL);
node->setAnimationSpeed( 3 );
camera->setTarget( node->getPosition() );
while(device->run())
{
if (device->isWindowActive())
{
driver->beginScene(true, true, 0 );
smgr->drawAll();
driver->endScene();
swprintf ( wcap , L"Current FPS %d" , driver->getFPS() );
device -> setWindowCaption ( wcap );
}
else
{
Sleep(10);
}
}
device->drop();
return 0;
}
The problem is that the animation isnt smooth between Last > First frame.
It looks like some problem/bug with animation interpolation.
Can anyone tell me what am i doing wrong ? Or maybe its a bug ?
Edit: Its not a ms3d format bug, i tested b3d also and it looks exactly the same.
Please check that problem before you reply in a "maybe set frameloop" style I already did all i could to fix that and im stuck.