SetPosition and Collisions

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Mloren
Posts: 114
Joined: Mon Aug 07, 2006 2:30 am
Location: Australia
Contact:

SetPosition and Collisions

Post by Mloren »

I have a FPS cam with a collision responce animator on it (basicaly the same as in the quake level tutorial).

If i try to use setPosition to move the camera to another room (ie teleport) it stops on the wall, it seems the collision system wont let it move through the wall, even if you set its position a long way away (would have thought it would be able to jump through it if moved far enough to not end up stuck in the wall).

So i guess my question is how do you work around this? iks there like an off switch for collisions so i can turn it off, move and then turn it back on?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Yes, you're right, if you move a node with collision response it stops at every obstacle that is in its way !!!

I found no switch for enable/disable the collision response animator, but you can remove and add it !!!
So if you want to move the node use removeAnimator(ISceneNodeAnimator *animator) to remove the animator...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Mloren
Posts: 114
Joined: Mon Aug 07, 2006 2:30 am
Location: Australia
Contact:

Post by Mloren »

I only just got around to testing this (long time i know)

but if i remove the animator then move the camera and then re-ad the animator, the animator pops the camera back to where it was.

i tried removing and destroying the animator, moving the camera then making a new animator and adding that but that doesnt work either. for some reason gravity doesnt work any more even though the gravity is definately being set in the animator.

note im trying to do this ever frame. i thought it would work since surely the collision animators only do stuff during the pre or post render, so anything i do to them during my updates shouldnt effect that, but it seems it does.

any other ideas for ways around this?
HondaDarrell
Posts: 20
Joined: Sun Aug 27, 2006 9:10 pm
Location: U.S.A.
Contact:

Post by HondaDarrell »

I'm trying something similar. I'm using a camera node with a collision response animator. But when I try setting the position of the camera nothing happens. Does the animator interfere with manual translation?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Yeah this happens to me too.
Post Reply