Node following another Node
-
- Posts: 23
- Joined: Thu Jan 29, 2004 4:07 pm
- Location: Birmingham, UK
- Contact:
Node following another Node
Hi
How would you get a node to follow another node? For example a player with an enemy character chasing after him. I know it's a bit of a generalised question but can anyone point me in the right direction?
Also is it possible to display time.
How would you get a node to follow another node? For example a player with an enemy character chasing after him. I know it's a bit of a generalised question but can anyone point me in the right direction?
Also is it possible to display time.
-
- Posts: 23
- Joined: Thu Jan 29, 2004 4:07 pm
- Location: Birmingham, UK
- Contact:
-
- Posts: 52
- Joined: Wed Mar 03, 2010 7:11 pm
rotating
how would i go about doing this? I've got everything set up, but the chasing isn't working because of this.rotate chasing object to face target (enemy)
Kamikaze
From this thread: http://irrlicht.sourceforge.net/phpBB2/ ... php?t=1325
By squisher
By squisher
Code: Select all
vector3df nodePos = node->getPosition();
vector3df targetPos = targetNode->getPosition();
vector3df diff = targetPos - nodePos;
node->setRotation(diff.getHorizontalAngle());
node->updateAbsolutePosition();
-
- Posts: 52
- Joined: Wed Mar 03, 2010 7:11 pm
-
- Posts: 52
- Joined: Wed Mar 03, 2010 7:11 pm
well i'm using this code for it
looks like they are using quats for it. i'm going to take a loot at it some more later.
Code: Select all
btMatrix3x3 orn = rigidbody->getWorldTransform().getBasis();
orn *= btMatrix3x3(btQuaternion(btVector3(0,1,0), 0.06));
rigidbody->getWorldTransform().setBasis(orn);
Kamikaze