![]() |
naev 0.10.4
|
Contains all the player autonav related stuff. More...
#include "player.h"#include "array.h"#include "board.h"#include "conf.h"#include "map.h"#include "pause.h"#include "pilot.h"#include "pilot_ew.h"#include "sound.h"#include "space.h"#include "toolkit.h"Go to the source code of this file.
Functions | |
| static int | player_autonavSetup (void) |
| Prepares the player to enter autonav. More... | |
| static void | player_autonav (void) |
| Handles the autonavigation process for the player. More... | |
| static int | player_autonavApproach (const vec2 *pos, double *dist2, int count_target) |
| Handles approaching a position with autonav. More... | |
| static void | player_autonavFollow (const vec2 *pos, const vec2 *vel, const int follow, double *dist2) |
| Handles following a moving point with autonav (PD controller). More... | |
| static int | player_autonavApproachBoard (const vec2 *pos, const vec2 *vel, double *dist2, double sw) |
| static int | player_autonavBrake (void) |
| Handles the autonav braking. More... | |
| void | player_autonavResetSpeed (void) |
| Resets the game speed. More... | |
| void | player_autonavStart (void) |
| Starts autonav. More... | |
| void | player_autonavEnd (void) |
| Ends the autonav. More... | |
| void | player_autonavStartWindow (unsigned int wid, const char *str) |
| Starts autonav and closes the window. More... | |
| void | player_autonavPos (double x, double y) |
| Starts autonav with a local position destination. More... | |
| void | player_autonavSpob (const char *name, int tryland) |
| Starts autonav with a spob destination. More... | |
| void | player_autonavPil (unsigned int p) |
| Starts autonav with a pilot to follow. More... | |
| void | player_autonavBoard (unsigned int p) |
| Starts autonav with a pilot to board. More... | |
| static void | player_autonavRampdown (double d) |
| Handles common time accel ramp-down for autonav to positions and spobs. More... | |
| void | player_autonavAbortJump (const char *reason) |
| Aborts regular interstellar autonav, but not in-system autonav. More... | |
| void | player_autonavAbort (const char *reason) |
| Aborts autonav. More... | |
| int | player_autonavShouldResetSpeed (void) |
| Checks whether the speed should be reset due to damage or missile locks. More... | |
| void | player_thinkAutonav (Pilot *pplayer, double dt) |
| Handles autonav thinking. More... | |
| void | player_updateAutonav (double dt) |
| Updates the player's autonav. More... | |
Variables | |
| double | player_acc |
| static double | tc_mod = 1. |
| static double | tc_base = 1. |
| static double | tc_down = 0. |
| static int | tc_rampdown = 0 |
| static double | last_shield |
| static double | last_armour |
| static int | target_known = 0 |
Contains all the player autonav related stuff.
Definition in file player_autonav.c.
|
static |
Handles the autonavigation process for the player.
Definition at line 336 of file player_autonav.c.
| void player_autonavAbort | ( | const char * | reason | ) |
Aborts autonav.
| reason | Human-readable string describing abort condition. |
Definition at line 297 of file player_autonav.c.
| void player_autonavAbortJump | ( | const char * | reason | ) |
Aborts regular interstellar autonav, but not in-system autonav.
| reason | Human-readable string describing abort condition. |
Definition at line 278 of file player_autonav.c.
|
static |
Handles approaching a position with autonav.
| [in] | pos | Position to go to. |
| [out] | dist2 | Square distance left to target. |
| count_target | If 1 it subtracts the braking distance from dist2. Otherwise it returns the full distance. |
Definition at line 535 of file player_autonav.c.
|
static |
Definition at line 621 of file player_autonav.c.
| void player_autonavBoard | ( | unsigned int | p | ) |
Starts autonav with a pilot to board.
Definition at line 237 of file player_autonav.c.
|
static |
Handles the autonav braking.
Definition at line 661 of file player_autonav.c.
| void player_autonavEnd | ( | void | ) |
Ends the autonav.
Definition at line 149 of file player_autonav.c.
|
static |
Handles following a moving point with autonav (PD controller).
| [in] | pos | Position to go to. |
| [in] | vel | Velocity of the target. |
| [in] | follow | Whether to follow, or arrive at |
| [out] | dist2 | Distance left to target. |
Definition at line 583 of file player_autonav.c.
| void player_autonavPil | ( | unsigned int | p | ) |
Starts autonav with a pilot to follow.
Definition at line 220 of file player_autonav.c.
| void player_autonavPos | ( | double | x, |
| double | y | ||
| ) |
Starts autonav with a local position destination.
Definition at line 173 of file player_autonav.c.
|
static |
Handles common time accel ramp-down for autonav to positions and spobs.
Definition at line 259 of file player_autonav.c.
| void player_autonavResetSpeed | ( | void | ) |
Resets the game speed.
Definition at line 52 of file player_autonav.c.
|
static |
Prepares the player to enter autonav.
Definition at line 104 of file player_autonav.c.
| int player_autonavShouldResetSpeed | ( | void | ) |
Checks whether the speed should be reset due to damage or missile locks.
Definition at line 687 of file player_autonav.c.
| void player_autonavSpob | ( | const char * | name, |
| int | tryland | ||
| ) |
Starts autonav with a spob destination.
Definition at line 188 of file player_autonav.c.
| void player_autonavStart | ( | void | ) |
Starts autonav.
Definition at line 62 of file player_autonav.c.
| void player_autonavStartWindow | ( | unsigned int | wid, |
| const char * | str | ||
| ) |
Starts autonav and closes the window.
Definition at line 162 of file player_autonav.c.
| void player_thinkAutonav | ( | Pilot * | pplayer, |
| double | dt | ||
| ) |
Handles autonav thinking.
| pplayer | Player doing the thinking. |
| dt | Current delta tick. |
Definition at line 772 of file player_autonav.c.
| void player_updateAutonav | ( | double | dt | ) |
Updates the player's autonav.
| dt | Current delta tick (should be real delta tick, not game delta tick). |
Definition at line 802 of file player_autonav.c.
|
static |
Player's last armour value.
Definition at line 36 of file player_autonav.c.
|
static |
Player's last shield value.
Definition at line 35 of file player_autonav.c.
|
extern |
|
static |
Is the target known?
Definition at line 37 of file player_autonav.c.
|
static |
Base compression modifier.
Definition at line 32 of file player_autonav.c.
|
static |
Rate of decrement.
Definition at line 33 of file player_autonav.c.
|
static |
Time compression modifier.
Definition at line 31 of file player_autonav.c.
|
static |
Ramping down time compression?
Definition at line 34 of file player_autonav.c.