Local Co-ordinates for Scene Nodes

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
A.Russell
Posts: 56
Joined: Sun May 15, 2005 2:52 pm

Local Co-ordinates for Scene Nodes

Post by A.Russell »

I've gone through the movement tutorial, but it only gives an example of moving using world co-ordinates or aataching an animator. Are there any functions for moving in local co-ordinates, ie up/down, left/right and sideways?
A.Russell
Posts: 56
Joined: Sun May 15, 2005 2:52 pm

Post by A.Russell »

Bump

So how do the rest of you do it?

I haven't found the animators much use. They do some cool things, but there is not much control over them.

If there isn't a way to simply rotate and move a node relative to itself, then how do the rest of you make your own movement functions?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

okay i'm not near any source code at the moment, but something like this is the basic idea-

core::matrix4 m;
core::vector3df direction = core::vector3df(1.0f,0,0); // moving right
m.setRotation(node->getRotation());
m.transformVector(direction);
node->setPosition(node->getPosition() + direction);

I think I remember someone doing a MoveForwards function, try searching for it
A.Russell
Posts: 56
Joined: Sun May 15, 2005 2:52 pm

Post by A.Russell »

Thanks a lot Bitplane. That looks like what I'm afterIf you come accross the source code, could you post it anyway? In the meantime I'll see how it goes with what you've offered.
Post Reply