Small feature request

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Anteater
Posts: 266
Joined: Thu Jun 01, 2006 4:02 pm
Location: Earth
Contact:

Small feature request

Post by Anteater »

It would be nice if it was possible to change the no vertical movement attribute of a FPS cam after it's created.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Bitplane is planning for a new way of camera movement, so called camera animators. This will introduce much more flexibility to all cameras, so let's hope he gets this done soon :)
Nodtveidt
Posts: 67
Joined: Fri Dec 15, 2006 4:41 am
Location: Isabela, PR
Contact:

Post by Nodtveidt »

That would be great; the current camera scheme is pretty static.
We all live in a yellow subroutine.

(\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

lol don't bet on it bitplane has his hands full and mine.

give him a month or two and irrlicht will be spit shined though.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

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.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Nodtveidt
Posts: 67
Joined: Fri Dec 15, 2006 4:41 am
Location: Isabela, PR
Contact:

Post by Nodtveidt »

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. :(
We all live in a yellow subroutine.

(\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Anteater
Posts: 266
Joined: Thu Jun 01, 2006 4:02 pm
Location: Earth
Contact:

Post by Anteater »

If I had the experience, I'd fix it myself but I don't so sorry, no dice here.
Same here. If I could do it, I'd would have posted it in the code snippets forum by now.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

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. :(
Yes. You right.
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 .........
If you realy need -- you can downlaod the sources/binaries and see the result in my Solar Model project to see it "in action". After increasing/descreasing time speed changing of camera look for user very transparent.
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

Post by Phant0m51 »

Back near SVN Rev 448 there was a change to the FPS Camera that allowed to get/set movespeed. If I get some time here in the next few hours I'll find the additions to the Scene Manager and FPS Camera and post them here.
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

Post by Phant0m51 »

In your CCameraFPSSceneNode.h add these lines:

Code: Select all

virtual void setMoveSpeed(const f32 speed);
virtual f32 getMoveSpeed();
In your CCameraFPSSceneNode.CPP

Code: Select all

void CCameraFPSSceneNode::setMoveSpeed(const f32 speed)
{
MoveSpeed = speed;
}

f32 CCameraFPSSceneNode::getMoveSpeed()
{
return MoveSpeed;
}
In your ICameraSceneNode.h

Code: Select all

virtual void setMoveSpeed(const f32 speed) { };
virtual f32 getMoveSpeed()
{
return 0.0f;
}
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.
Post Reply