Game Development Community

Finding the Front.

by Badguy · in Torque Game Engine · 10/25/2002 (1:45 pm) · 3 replies

Ok,
if I have a Matrix representing my objects position and rotation..
How can I use this to make a point that is directly in front of said object say 10 units?
heh seems simple enuff to me but I dont know how to do it. going over some resources I have here suggests I need to calculate the eigen values of my matrix .. is this the right way to do this?

I dont see any direct support for this in here ..
am I missing something?

#1
11/04/2002 (1:35 pm)
woot I figured this out ..
without using Eigen values.

Now I have AI race car drivers :)

if anyone else wants to know I can show.
#2
11/04/2002 (2:42 pm)
You have AI vehicles???
/ME wants them badly, too... ;))
Would be cool if you could post how you did it... :)
Thx!
(which reminds me, I still got your ladder code, time to try that out... :)
#3
11/04/2002 (4:45 pm)
sure well I started with creating the AIObjective class ..
and put in all the handlers for that with the exception of operating the vector array inside the AIPlayer
(adding removing objectives) ive kept the rest in the script

with that I had to modify the getAIMove to if mounted call a new function I wrote that would derive how to set up the yaw based on a triangle made from the center front and destination using the angle calculated there ..
I only had to unrotate the destination based on my rotation inversed so I could do a planer x test for left and right turns .. all in all its pretty tight
they are really good at steering adding support for z would be a cakewalk from here.

to post this I would need to post the AIObjective code
and that is a little heavy now as its a GameBase object! :)
so first I will lower it to like SimObject with SimDataBlock then if you want I can hook you up.

I got a guy here workin on the ladder too.

but with this new stuff I learned im gonna fix the door too :) ive already fixed a buncha stuff with it now it does the path following proper using script callbacks and next ive just to fix the rotation code .. then it needs lighting and that is about it