SceneNode's position not updating

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
nayon
Posts: 16
Joined: Mon Mar 16, 2009 1:07 pm

SceneNode's position not updating

Post by nayon »

Hi everyone, I have a problem.

I'm trying to navigate an AnimatedMeshSceneNode through some predefined waypoints. It goes through some, then gets stuck at one. I checked through debugging, and

Code: Select all

adana=agent_node->getPosition();

// ...some operations on adana...

agent_node->setPosition((core::vector3df)adana);
agent_node->updateAbsolutePosition();
adana=agent_node->getPosition();
I check the value of adana at each time, but here's the problem. When I setPosition the node, I check it to make sure it is different from the previous position through VS's debug. But the node's position doesn't change, and during the beginning of the next step, when I get the value of the position, it's still the same value with the previous step, even though I had seen with my own eyes that it had changed. What might be the cause of this?
Ariemeth
Posts: 3
Joined: Sat Jun 07, 2008 12:54 pm

Post by Ariemeth »

Glad to know its not just me. I have been beating my head against the wall with this same issue. I knew I was seeing the variables change but then after the scene is rendered the values are back to where they were to start with.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Are you sure you want to use the relative position, or do you need to check getAbsolutePosition? for the relative position you don't even need to update the absolute position...
Post Reply