Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
steerlib.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

vector steerlib_arrive (entity this, vector point, float maximal_distance)
 Pull toward a point, The further away, the stronger the pull.
vector steerlib_attract2 (entity this, vector point, float min_influense, float max_distance, float max_influense)

Variables

vector steerto

Function Documentation

◆ steerlib_arrive()

vector steerlib_arrive ( entity this,
vector point,
float maximal_distance )

Pull toward a point, The further away, the stronger the pull.

Definition at line 27 of file steerlib.qc.

28{
29 float distance = bound(0.001, vlen(this.origin - point), maximal_distance);
30 vector direction = normalize(point - this.origin);
31 return direction * (distance / maximal_distance);
32}
vector origin
float bound(float min, float value, float max)
float vlen(vector v)
vector normalize(vector v)
vector
Definition self.qh:92

References bound(), entity(), normalize(), origin, vector, and vlen().

Referenced by ewheel_move_enemy(), steerlib_flock(), steerlib_flock2d(), and steerlib_swarm().

◆ steerlib_attract2()

vector steerlib_attract2 ( entity this,
vector point,
float min_influense,
float max_distance,
float max_influense )

Definition at line 45 of file steerlib.qc.

46{
47 float distance = bound(0.00001, vlen(this.origin - point), max_distance);
48 vector direction = normalize(point - this.origin);
49
50 float influense = 1 - (distance / max_distance);
51 influense = min_influense + (influense * (max_influense - min_influense));
52
53 return direction * influense;
54}

References bound(), entity(), normalize(), origin, vector, and vlen().

Referenced by ewheel_move_path(), Monster_Move(), walker_move_path(), and walker_move_to().

Variable Documentation

◆ steerto