Page 1 of 1

CollisionResponse and FlyStraight

Posted: Thu Nov 17, 2005 7:27 pm
by Delan
I must use Flystraight animator to move node. When i use it, node moves, but the collisionresponseanimator disappear... (but when i moving node using setPosition, collisions are ok) How to use collision animator and flystraight animator in the same time? i add move anim.:

Code: Select all

ISceneNodeAnimator* moveanim=irrSceneMgr->createFlyStraightAnimator(node->getPosition(), endpos, 20);
node->addAnimator(moveanim);
moveanim->drop();
while node needs to move (node needs to move when W Key pressed)

Posted: Fri Nov 18, 2005 2:41 pm
by SanderVocke
If you're talking about the main game character which needs to be moved with the W button, choosing for the FlyStraight animator probably isnt the best choice. I don't know how to solve your problem, but I advise you to write a game loop instead that makes the node move (*constant* x elapsed frame time) units forward.

Posted: Fri Nov 18, 2005 4:31 pm
by Guest
I also advise your to not use the collisionresponse animator, if you create your own move method (increase position untill you reached the target) your should also use your "own" collision (test a few times the height of your map and then generate a path) - this is much faster, specially when you use many many nodes moving around (collision tests after every movement, your own path tests 3-4 times at the beginning and then simply moves without testing).