Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
vehicles.qc
Go to the documentation of this file.
1#include "vehicles.qh"
2
3#ifdef GAMEQC
4float vehicle_altitude(entity this, float amax)
5{
6 tracebox(this.origin, this.mins, this.maxs, this.origin - ('0 0 1' * amax), MOVE_WORLDONLY, this);
7 return vlen(this.origin - trace_endpos);
8}
9
10vector vehicles_force_fromtag_hover(entity this, string tag_name, float spring_length, float max_power)
11{
12 force_fromtag_origin = gettaginfo(this, gettagindex(this, tag_name));
14 traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, this);
15
16 force_fromtag_power = (1 - trace_fraction) * max_power;
18
20}
21
22vector vehicles_force_fromtag_maglev(entity this, string tag_name, float spring_length, float max_power)
23{
24 force_fromtag_origin = gettaginfo(this, gettagindex(this, tag_name));
26 traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, this);
27
28 // TODO - this may NOT be compatible with wall/celing movement, unhardcode 0.25 (engine count multiplier)
29 if(trace_fraction == 1.0)
30 {
32 return '0 0 -200';
33 }
34
37
39}
40#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const float MOVE_NORMAL
vector mins
vector trace_endpos
vector maxs
float MOVE_WORLDONLY
vector v_forward
vector origin
float trace_fraction
#define gettagindex
float vlen(vector v)
vector normalize(vector v)
#define gettaginfo
Definition post.qh:32
vector
Definition self.qh:92
vector vehicles_force_fromtag_hover(entity this, string tag_name, float spring_length, float max_power)
Definition vehicles.qc:10
float vehicle_altitude(entity this, float amax)
Definition vehicles.qc:4
vector vehicles_force_fromtag_maglev(entity this, string tag_name, float spring_length, float max_power)
Definition vehicles.qc:22
float force_fromtag_power
Definition vehicles.qh:4
vector force_fromtag_origin
Definition vehicles.qh:6
float force_fromtag_normpower
Definition vehicles.qh:5