Small feature request
Small feature request
It would be nice if it was possible to change the no vertical movement attribute of a FPS cam after it's created.
I can manage, but if someone else wants to make a start on it I'm cool with that too 
It's a nice simple addition, nothing more than a mixture of event reciever and animator, split out from the inbuilt cameras so that a Maya camera is just a camera scene node with a Maya controller, and an FPS cam just has an FPS controller.
It's a nice simple addition, nothing more than a mixture of event reciever and animator, split out from the inbuilt cameras so that a Maya camera is just a camera scene node with a Maya controller, and an FPS cam just has an FPS controller.
Yes. You right.Nodtveidt wrote:The current FPS camera is very limited (can't adjust the speed after it's set, for example). If I had the experience, I'd fix it myself but I don't so sorry, no dice here.
You have to ways ( as i had ):
- wait for irrlicht version that will has more flexible camera;
- try some kind of "cheat"
In my project i needed to changed camera's speed either. Because when i changing time speed -- it affects camera's speed too. So i decided to recreate a camera every time i need to changed camera's speed. All the values of the current camera should be copied to new one -- make it twin. It is looks like this:
Code: Select all
........... // here i setting required t .................
Game.Timer->setSpeed( t );
ICameraSceneNode* curcam = Game.Scene->getActiveCamera();
ICameraSceneNode* newcam = GameFPSCamera( vector3df( -500.0f, 0.0f, -200.0f ), 50.0f, cam_movespeed/(t/(0.001f*60.0f)) );
Game.Scene->setActiveCamera( curcam );
newcam->setInputReceiverEnabled( cam_inputreceive );
newcam->setFarValue( curcam->getFarValue() );
newcam->setPosition( curcam->getPosition() );
newcam->setRotation( curcam->getRotation() );
newcam->setUpVector( curcam->getUpVector() );
newcam->setTarget( curcam->getTarget() );
Game.Scene->getActiveCamera()->remove();
Game.Scene->setActiveCamera( newcam );
................ // from now new camera used .........
In your CCameraFPSSceneNode.h add these lines:
In your CCameraFPSSceneNode.CPP
In your ICameraSceneNode.h
That will give you the option to get and set the movespeed of the camera. You shouldn't have a problem getting/setting vertical movement, rotation, or anything else you need.
Code: Select all
virtual void setMoveSpeed(const f32 speed);
virtual f32 getMoveSpeed();Code: Select all
void CCameraFPSSceneNode::setMoveSpeed(const f32 speed)
{
MoveSpeed = speed;
}
f32 CCameraFPSSceneNode::getMoveSpeed()
{
return MoveSpeed;
}Code: Select all
virtual void setMoveSpeed(const f32 speed) { };
virtual f32 getMoveSpeed()
{
return 0.0f;
}