Also, note my reference to createFlyStraightAnimator. As you can probably guess this is my very lame way of getting the camera to sit still at a particular spot. I've justmodified example code. What's the right way to achieve a camera in one static location?
Code: Select all
scene::IAnimatedMeshSceneNode* anms =
smgr->addAnimatedMeshSceneNode(smgr->getMesh("animation.3ds"));
if (anms)
{
scene::ISceneNodeAnimator* anim =
smgr->createFlyStraightAnimator(core::vector3df(0,-20,50),
core::vector3df(0,-20,50), 3500, true);
if (anim)
{
anms->addAnimator(anim);
anim->drop();
}
anms->setMaterialFlag(video::EMF_LIGHTING, false);
anms->setFrameLoop(1, 200);
anms->setAnimationSpeed(15);
anms->setScale(core::vector3df(2.f,2.f,2.f));
}
smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
gui::IGUIStaticText* diagnostics = device->getGUIEnvironment()->addStaticText(
L"", core::rect<s32>(10, 10, 400, 20));
diagnostics->setOverrideColor(video::SColor(255, 255, 255, 0));*/
int lastFPS = -1;
u32 then = device->getTimer()->getTime();
const f32 MOVEMENT_SPEED = 5.f;
while(device->run())
{
//key stroke check code removed for brevity
}