Page 1 of 1

set position of FPS-cam

Posted: Tue Jul 20, 2004 10:53 pm
by Acki
Hi,
I addet a FPS-cam to the Q3-map from the Irrlicht's media folder.
If I set the cam's position before I add the CollisionResponseAnimator, the cam's position is OK.
But If I set the cam's position after I add the CollisionResponseAnimator, the cam's position is wrong.
This seems to depand on the actual cam's position...
If I stand at different positions and set the position new, the cam will be set to a another position (not that I told the cam to set to).
But also there is a region, where the cam will be set to the right position...

What's wrong with it and how can I resolve this ???

thx, Acki

Posted: Thu Jul 22, 2004 1:02 am
by Acki
Now I know what the problem is.
It seems that if the collisionRespons is active the camera's position can't be set to a position where the cam has to move trough a wall !!!
Is there a way to disable the collision response of the cam ???

CU, Acki

Posted: Thu Jul 22, 2004 4:07 am
by Asterisk Man
ICameraSceneNode *->removeAnimator(ISceneNodeAnimator *);

this should work, provided you haven't dropped the animator pointer, although im not sure if it works even after that, as I haven't tried it.

Posted: Thu Jul 22, 2004 2:28 pm
by Acki
Well, I tried this allready - it didn't work... :cry:

Posted: Fri Jul 23, 2004 12:00 am
by Acki
Well, I got a solution...
But it seems not to be the very best... ;)

1. I copy the pointer from the cam to a temporary ICameraSceneNode*
2. I create a new cam and store the pointer
3. I position the new cam
4. I set the colision response animator to the new cam
5. I set the new cam as active
6. I remove the old cam (the temporary)

If I don't use the temp cam, the prog crashes, because without a cam Irrlicht can't render anything and breaks down...

Any better ideas ???

CU, Acki

Posted: Fri Jul 23, 2004 1:35 am
by thesmileman
are you using setPosition or setAbsolutePosition? :D

Posted: Fri Jul 23, 2004 4:04 pm
by Acki
Well, I can't use a function that doesn' exist !!!
Do you ????


CU, Acki

Posted: Fri Jul 23, 2004 9:17 pm
by thesmileman
Sorry I F'ed up I ment when you check the position are you using getPosition or getAbsolutePosition() :(

Posted: Fri Jul 23, 2004 9:44 pm
by Acki
Why should I check the position of the FPS cam, because I can see that it's not on the right position ??? :roll:
It doesn't matter to me what position the cam is at, if it's at the wrong pos...

Well, for my solution I get the position with getPosition() - because the cam is no child of anything and so getPosition() and getAbsolutePosition() gives me the same results... ;)