And it works with the following code, but it doesn't work perfectly. A lot of the times I have to push the key real hard for it to switch, or multiple times. Could anyone tell me if the problem with the switching is due to my code or is it something that can't be fixed?
Code: Select all
IAnimatedMeshSceneNode* node = node1;
int pom = 1;
//later, in the while(device->run()) loop
if(receiver.IsKeyDown(irr::KEY_KEY_S))
{
if(pom == 1)
{
node = node2;
pom = 2;
cam->setPosition(core::vector3df(60,-10,-10));
cam->setTarget(core::vector3df(70,0,50));
}
else
{
node = node1;
pom = 1;
cam->setPosition(core::vector3df(50,-10,-10));
cam->setTarget(core::vector3df(50,0,50));
}
}