She does take a step (as was), and a step again... But before she could finish her step she began to shake again.
change model animation
Thanks for your help, but
...
She does take a step (as was), and a step again... But before she could finish her step she began to shake again.
She does take a step (as was), and a step again... But before she could finish her step she began to shake again.
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
My code is now:
The mouse works fine
at puching W the program crashes, I think default is wrong.
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
IAnimatedMeshSceneNode* node = 0;
IrrlichtDevice* device=0;
int main()
{
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
static bool model_anim = false;
if (event.EventType == EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown && !model_anim)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_W:
{
node->setMD2Animation(irr::scene::EMAT_RUN);
model_anim = true;
}
case KEY_ESCAPE:
{
device->closeDevice();
}
default:
{
node->setMD2Animation(irr::scene::EMAT_STAND);
model_anim = false;
}
}
}
if(event.EventType == EET_MOUSE_INPUT_EVENT && event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN )
{
node->setMD2Animation(irr::scene::EMAT_SALUTE);
model_anim = false;
}
return false;
}
};
MyEventReceiver receiver;
IrrlichtDevice *device =
createDevice(DT_SOFTWARE, dimension2d<s32>(512, 384), 16, false, false, &receiver);
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
guienv->addStaticText(L"Hello World! This is the Irrlicht Software engine!",
true, rect<int>(10,10,200,30));
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
node = smgr->addAnimatedMeshSceneNode( mesh );
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setFrameLoop(0, 310);
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
}
smgr->addCameraSceneNode(0, vector3df(0,10,-40), vector3df(0,0,0));
while(device->run())
{
driver->beginScene(true, true, SColor(0,100,100,100));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
Visit my website @ www.venex.be
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP
Plethora project will be added to the site
AMD AthlonXP 2600+, 512MB DDR, Radeon M10 (mobile 9600) PRO 64MB, WinXP