Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Traceline

From Quake Wiki

Revision as of 21:56, 22 February 2008 by 129.13.186.4 (talk) (New page: '''traceline'''(vector ''v1'', vector ''v2'', float ''nomonsters'', entity ''forent'') ''v1'' = start of line ''v2'' = end of line ''nomonster'' = if TRUE, then see through other monst...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
traceline(vector v1, vector v2, float nomonsters, entity forent)

v1 = start of line

v2 = end of line

nomonster = if TRUE, then see through other monsters, else FALSE.

forent = ignore this entity, it's owner, and it's owned entities. if forent = world, then ignore no entity.

Trace a line of sight, possibly ignoring monsters, and possibly ignoring the entity forent (usually, forent = self). This function is used very often, tracing and shot targeting. Traces are blocked by bounding boxes and exact bsp entities. Returns the results in the global variables:

float trace_allsolid;

 // never used

float trace_startsolid;

 // never used

float trace_fraction;

 // fraction (percent) of the line that was traced, before
 // an obstacle was hit. Equal to 1 if no obstacle were found.

vector trace_endpos;

 // point where line ended or met an obstacle.

vector trace_plane_normal;

 // direction vector of trace (?)

float trace_plane_dist;

 // distance to impact along direction vector (?)

entity trace_ent;

 // entity hit by the line

float trace_inopen;

 // boolean, true if line went through non-water area.

float trace_inwater;

 // boolean, true if line went through water area.