CollisionResponse and FlyStraight

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
Delan
Posts: 24
Joined: Sun Nov 06, 2005 10:46 am
Location: Polend
Contact:

CollisionResponse and FlyStraight

Post 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)
And time has come now to ride
before the end of the night
the march of the swordmaster
to the unholy fight
SanderVocke
Posts: 40
Joined: Mon Oct 31, 2005 1:19 pm
Location: Netherlands

Post 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.
"The shortest distance between two points is always under construction."
- Noelie Alite
Guest

Post 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).
Post Reply