1.4 -> FPSCamera->SetPosition

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
Wyszo
Posts: 49
Joined: Sun Jun 24, 2007 8:44 am

1.4 -> FPSCamera->SetPosition

Post by Wyszo »

Irrlicht 1.4 beta (linux)

Function SetPosition in FPS camera class produces strange results. I tell it to place the camera in the given position and it place it in a completely different point (like - a semi-random one). I am 100% sure, that I know where the given position is (I draw a box there ;P), and that the camera lands somewhere else. So - basically it's probably not the engine bug, but my lack of knowledge. Do I have to call some other function before changing position in real time? Any ideas?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Did it work in previous irrlicht versions?

Are you using any collision detection?
Image Image Image
Wyszo
Posts: 49
Joined: Sun Jun 24, 2007 8:44 am

Post by Wyszo »

JP wrote:Did it work in previous irrlicht versions?
I don't know. I've never been using FPS Camera in previous versions. I'll check it when I have some spare time [yeah, this sentence probably has nothing to do with English grammar :D].
JP wrote:Are you using any collision detection?
Yes, but I "teleport" camera much above the ground, so that collision ellipsoid doesn't touch the level mesh.
Wyszo
Posts: 49
Joined: Sun Jun 24, 2007 8:44 am

Post by Wyszo »

Ok, you may safely disregard this toppic. I tested my code under 1.3.1 and it worked exactly the same way. So I used the template from one of the tutorials to check whether setPosition works as we all expect. Of course - it does. So I must have put this function with other argument somewhere else in my code (and forgot about that), there is no other explanation. Sorry for being troublesome :)

EDIT:

:P :P :P :P :P
Ok, I found it - heh, stupid of me. Like JP suggested I use collision response animator and that causes a problem. Of course I don't know how to change position of a mesh controlled by this animator...
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Perhaps, you could remove the animator, do your teleport move, then reapply the animator?
Post Reply