Xonotic
laser.qh
Go to the documentation of this file.
1 #pragma once
2 
3 // a laser goes from origin in direction angles
4 // it has color 'beam_color'
5 // and stops when something is in the way
6 entityclass(Laser);
7 classfield(Laser) .int cnt; // end effect
8 classfield(Laser) .vector colormod;
9 classfield(Laser) .int state; // on-off
10 classfield(Laser) .int count; // flags for the laser
11 classfield(Laser) .vector velocity; // laser endpoint if it is FINITE
12 classfield(Laser) .float alpha;
13 classfield(Laser) .float scale; // scaling factor of the thickness
14 classfield(Laser) .float modelscale; // scaling factor of the dlight
15 
16 const int LASER_FINITE = BIT(1);
17 const int LASER_NOTRACE = BIT(2);
18 const int LASER_INVERT_TEAM = BIT(3);
19 
20 const int SF_LASER_UPDATE_ORIGIN = BIT(0);
21 const int SF_LASER_UPDATE_TARGET = BIT(1);
22 const int SF_LASER_UPDATE_ACTIVE = BIT(2);
23 const int SF_LASER_UPDATE_EFFECT = BIT(3);
24 
25 const int SF_LASER_NOTRACE = BIT(4);
26 const int SF_LASER_SCALE = BIT(5);
27 const int SF_LASER_ALPHA = BIT(6);
28 const int SF_LASER_FINITE = BIT(7);
29 
30 .vector beam_color;
31 
32 const float LASER_BEAM_MAXLENGTH = 32768; // maximum length of a beam trace
33 // TODO: find a better way to do this
34 const float LASER_BEAM_MAXWORLDSIZE = 1048576; // to make sure the endpoint of the beam is not visible inside
float state
Definition: subs.qh:32
const float LASER_BEAM_MAXLENGTH
Definition: laser.qh:32
const int SF_LASER_UPDATE_EFFECT
Definition: laser.qh:23
float alpha
Definition: items.qc:14
const int LASER_NOTRACE
Definition: laser.qh:17
const float LASER_BEAM_MAXWORLDSIZE
Definition: laser.qh:34
vector colormod
Definition: powerups.qc:21
const int LASER_FINITE
Definition: laser.qh:16
classfield(Laser) .int cnt
const int SF_LASER_UPDATE_TARGET
Definition: laser.qh:21
vector beam_color
Definition: laser.qh:30
const int SF_LASER_UPDATE_ORIGIN
Definition: laser.qh:20
entityclass(Laser)
const int SF_LASER_SCALE
Definition: laser.qh:26
const int SF_LASER_ALPHA
Definition: laser.qh:27
const int SF_LASER_UPDATE_ACTIVE
Definition: laser.qh:22
const int SF_LASER_NOTRACE
Definition: laser.qh:25
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
float cnt
Definition: powerups.qc:24
const int SF_LASER_FINITE
Definition: laser.qh:28
float scale
Definition: projectile.qc:14
float count
Definition: powerups.qc:22
const int LASER_INVERT_TEAM
Definition: laser.qh:18
vector velocity
Definition: csprogsdefs.qc:103
float modelscale
Definition: models.qh:3