setposition cameraFPS

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

setposition cameraFPS

Post by Strong99 »

when i call setPositon() and give coords, the camera seems to jump randomly to a position,

irr::core::vector3df(0,0,0) always jum[s to the right position but when i set in to irr::core::vector3df(20,-10,10) i get 4 randomly positions,

example:
irr::core::vector3df(20,-10,10)
jumps to
irr::core::vector3df(20,2,11) or
irr::core::vector3df(23,0,13) or
irr::core::vector3df(200,100,25)

only + coords seems to work well most of the time
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

Post by Phant0m51 »

That's wierd. I use SetPosition to adjust the player's height during a jump and haven't had a single problem with it.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Does the camera has a collision response animator (and the map, too) ???
If so this could cause this behavior if you set the cam to a position that the cam has to move through an obstacle for moving to !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

yes i have, so do i have to stop it and restart it when i moved?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I had this problem too, when I first used the Irrlicht collision...
AFAIR I created a second cam, positioned it at the new pos and then I added a new collision response animator (probably there are better ways)...

There are also some threads about this problem in the forum...

But I switched verry fast to Newton, and with Newton you can disable a collision (freeze) and after positioning enable it again (unfreeze)...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Strong99
Admin
Posts: 687
Joined: Fri Mar 31, 2006 7:06 pm
Location: Netherlands
Contact:

Post by Strong99 »

before i do the setPostion() i remove the world from the animator, then setPos and then add the selctor to the animator, when i don't do the last step ( readding the selector ) i got on the position, but when i enable the world i jump back to a random position (same positions as before)

Code: Select all

this->gamecore->getSettings()->response_player->setWorld(0);
this->gamecore->getSettings()->getActiveCamera()->setPosition(irr::core::vector3df(1795,-420,486));
this->gamecore->getSettings()->response_player->setWorld(this->gamecore->getLoadEngine()->getSceneLoader()->getSelector());
Riki
Posts: 30
Joined: Tue Feb 27, 2007 9:12 pm
Location: Croatia

Post by Riki »

This is because the animators are updated even if detached from the node. So just removing them, seting the camera pos and attaching them would not help. You could remove the animator, drop it, change the position, create a new animator and attach it to the camera.

Maybe there are better solutions but I am not aware of them.


Regards
Post Reply