Camera FPS animator changing values?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
WLGfx
Posts: 9
Joined: Fri Nov 23, 2012 12:56 am

Camera FPS animator changing values?

Post by WLGfx »

I've added to my editor an FPS camera which I can switch on and off whether the right mouse button is being used. But in the editor I need to change the movement speed of the camera depending on the size of the scene.

How do I do one of these?

1. Grab the animator from the camera and change the speed?
2. Manually add an FPS animator to a camera?
WLGfx
Posts: 9
Joined: Fri Nov 23, 2012 12:56 am

Re: Camera FPS animator changing values?

Post by WLGfx »

After another thorough search I managed to figure it out by grabbing the list of animators and casting.

Code: Select all

    core::list<scene::ISceneNodeAnimator*>::ConstIterator anims
            =camera->getAnimators().begin();
    scene::ISceneNodeAnimatorCameraFPS *anim
            =(scene::ISceneNodeAnimatorCameraFPS*)*anims;
    anim->setMoveSpeed(moveSpeed);
    anim->setRotateSpeed(rotateSpeed);
Post Reply