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.
Dark_Exodus
Posts: 23 Joined: Thu Jan 29, 2004 4:07 pm
Location: Birmingham, UK
Contact:
Post
by Dark_Exodus » Wed Apr 28, 2004 4:10 pm
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.
arras
Posts: 1622 Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:
Post
by arras » Wed Apr 28, 2004 4:46 pm
thats simple AI what you need.
Basicly:
get coordinates of target object (player)
rotate chasing object to face target (enemy)
move chasing object forward
check if chasing ob. is not coliding with target
you have to do it periodicly (each loop or each X loops)
arras
Posts: 1622 Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:
Post
by arras » Wed Apr 28, 2004 4:49 pm
about time ...there is function to get time in Irrlicht ...i dont remember sintax, check documentation.
Dark_Exodus
Posts: 23 Joined: Thu Jan 29, 2004 4:07 pm
Location: Birmingham, UK
Contact:
Post
by Dark_Exodus » Thu Apr 29, 2004 11:48 am
ok thanks, I don't think I totally understand but I'll give it a shot. Also I've looked in the documentation and can't find anything about displaying time.
arras
Posts: 1622 Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:
Post
by arras » Thu Apr 29, 2004 2:05 pm
virtual u32 irr::ITimer::getTime() [pure virtual]
kamikaze942
Posts: 52 Joined: Wed Mar 03, 2010 7:11 pm
Post
by kamikaze942 » Tue May 11, 2010 4:18 pm
rotate chasing object to face target (enemy)
how would i go about doing this? I've got everything set up, but the chasing isn't working because of this.
Kamikaze
kamikaze942
Posts: 52 Joined: Wed Mar 03, 2010 7:11 pm
Post
by kamikaze942 » Wed May 12, 2010 4:01 am
nice! don't suppose you know how to convert that over to bullet rotations eh?
Kamikaze
Mag-got
Posts: 42 Joined: Tue Dec 04, 2007 5:53 pm
Post
by Mag-got » Wed May 12, 2010 2:26 pm
You mean the physics library? What does it need to be, degrees, radians, quaternion?
kamikaze942
Posts: 52 Joined: Wed Mar 03, 2010 7:11 pm
Post
by kamikaze942 » Wed May 12, 2010 5:39 pm
well i'm using this code for it
Code: Select all
btMatrix3x3 orn = rigidbody->getWorldTransform().getBasis();
orn *= btMatrix3x3(btQuaternion(btVector3(0,1,0), 0.06));
rigidbody->getWorldTransform().setBasis(orn);
looks like they are using quats for it. i'm going to take a loot at it some more later.
Kamikaze