I need a bit of help with vectors and direction. As I tried to create AI car which steers and move itself to the some point on the map, the car steers only to match the direction of the vector I told him to go. But it would be nice, if the car steers to the exact point. And yes, I’m using a part of code from MonkeyZone class AutonomousVehicleControl.
For example: the car starts at vector A (0, 0, 0), I tell it to go to vector B (0, 0, 10), the car will go straight forward because it match the rotation to vector B. BUT if I move the start point of the car to (5, 0, 0) but keep the rotation, car go again straight forward to the “vector B”. The problem in this case is that it misses the point and will go forward till the end of map.
I need to calculate new vector, what stores the direction between car and point and by which car can steer to the told point. Basic diagram below. The green point is location on the map, red one is vehicle, where arrow shows forward vector of the car.
I failed in solving this math problem
Thank for any help (or docs, topics where it has been already solved)