Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Editing traceline
From Quake Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | ====Syntax:==== | |
+ | <code>void traceline(vector v1, vector v2, float collisionType, entity ignore)</code> | ||
− | == | + | This function traces a line between v1 and v2 and sets many global variables depending on the results of the trace. |
− | + | ====Parameters:==== | |
− | + | :<code>v1</code> - The start point of the trace | |
− | : | + | :<code>v2</code> - The end point of the trace |
− | + | :<code>collisionType</code> - How the trace interacts with other entities. 0 makes it collide with both the world and solid entities' bounding box. 1 makes it not collide with monsters (solid entities with the FL_MONSTER flag set on .flags). 2 makes the trace extra wide against monsters. | |
− | : | + | ====Returns:==== |
− | + | :void | |
− | :The | + | ====Global variables affected:==== |
− | + | :<code>float trace_allsolid</code> - (?) | |
− | + | :<code>float trace_startsolid</code> - (?) | |
− | + | :<code>float trace_fraction</code> - The fraction of the total length of the vector v2 - v1 that was traced before the trace hit an obstacle. | |
− | + | :<code>vector trace_endpos</code> - The coordinates of the end point of the trace. If the trace did not hit anything, than trace_endpos = v2, otherwise it will report the position where the trace hit an obstacle. | |
− | + | :<code>vector trace_plane_normal</code> - The normal of the plane that was hit by the trace. | |
− | + | :<code>float trace_plane_dist</code> - The distance of the plane to the world origin (?) | |
− | + | :<code>entity trace_ent</code> - The entity that was hit by the trace (if nothing was hit, returns world). | |
− | + | :<code>float trace_inopen</code> - If the trace is in open air (?) | |
− | + | :<code>float trace_inwater;</code> - If the trace is in water (?) | |
− | : | ||
− | |||
− | : | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:QuakeC Function]] | [[Category:QuakeC Function]] |