.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Follow the waypoint without looking at it (http://forums.bots-united.com/showthread.php?t=2194)

bomberman 04-07-2004 08:16

Follow the waypoint without looking at it
 
Code:

// keep turning towards the waypoint...

  Vector v_direction = pBot->waypoint_origin - pEdict->v.origin;

  Vector v_angles = UTIL_VecToAngles(v_direction);

in HPB_template 3.0 , I found this code , it make the bot look at the waypoint , how can I make the bot follow the waypoint without looking at it ?

botman 04-07-2004 15:01

Re: Follow the waypoint without looking at it
 
Create a vector that will be the movement direction (i.e. a vector from the current bot's location to his desired destination).

Convert this vector to a set of angles and use the YAW angle to find the sine and cosine of it.

The sine and cosine can be used in the pfnRunPlayerMove as the forward speed and the side speed arguments.

botman


All times are GMT +2. The time now is 03:40.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.