set position of FPS-cam

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
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

set position of FPS-cam

Post 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
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Asterisk Man
Posts: 62
Joined: Wed Jun 09, 2004 5:51 am

Post 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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Well, I tried this allready - it didn't work... :cry:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post by thesmileman »

are you using setPosition or setAbsolutePosition? :D
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Well, I can't use a function that doesn' exist !!!
Do you ????


CU, Acki
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post by thesmileman »

Sorry I F'ed up I ment when you check the position are you using getPosition or getAbsolutePosition() :(
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply