I am trying to change the move speed of a FPS camera depending on its proximity to another object. Basically as the camera gets closer, it starts to slow down.
Here is how I accomplished it:
Code: Select all
core::list<ISceneNodeAnimator*>::ConstIterator anims=camera[0]->getAnimators().begin();
ISceneNodeAnimatorCameraFPS *anim=(ISceneNodeAnimatorCameraFPS*)*anims;
anim->setMoveSpeed(newCameraSpeed/1000);
When I create the FPS camera, the constructor scales the move speed by 1000. However when I change the speed, the scaling does not happen and I have to do it myself. This seems a bit counter-intuitive to me, because I expect the scale of the move speed to be the same no matter from where I set it.
So I'm wondering, is there a reason why changing the speed does not scale the move speed automatically?