|
ds@1990
|
1 |
/** |
|
ds@1990
|
2 |
* vim: set ts=4 : |
|
ds@1990
|
3 |
* ============================================================================= |
|
ds@1990
|
4 |
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. |
|
ds@1990
|
5 |
* ============================================================================= |
|
ds@1990
|
6 |
* |
|
ds@1990
|
7 |
* This file is part of the SourceMod/SourcePawn SDK. |
|
ds@1990
|
8 |
* |
|
ds@1990
|
9 |
* This program is free software; you can redistribute it and/or modify it under |
|
ds@1990
|
10 |
* the terms of the GNU General Public License, version 3.0, as published by the |
|
ds@1990
|
11 |
* Free Software Foundation. |
|
ds@1990
|
12 |
* |
|
ds@1990
|
13 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
ds@1990
|
14 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
ds@1990
|
15 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
ds@1990
|
16 |
* details. |
|
ds@1990
|
17 |
* |
|
ds@1990
|
18 |
* You should have received a copy of the GNU General Public License along with |
|
ds@1990
|
19 |
* this program. If not, see <http://www.gnu.org/licenses/>. |
|
ds@1990
|
20 |
* |
|
ds@1990
|
21 |
* As a special exception, AlliedModders LLC gives you permission to link the |
|
ds@1990
|
22 |
* code of this program (as well as its derivative works) to "Half-Life 2," the |
|
ds@1990
|
23 |
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software |
|
ds@1990
|
24 |
* by the Valve Corporation. You must obey the GNU General Public License in |
|
ds@1990
|
25 |
* all respects for all other code used. Additionally, AlliedModders LLC grants |
|
ds@1990
|
26 |
* this exception to all derivative works. AlliedModders LLC defines further |
|
ds@1990
|
27 |
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), |
|
ds@1990
|
28 |
* or <http://www.sourcemod.net/license.php>. |
|
ds@1990
|
29 |
* |
|
ds@1990
|
30 |
* Version: $Id$ |
|
ds@1990
|
31 |
*/ |
|
ds@1990
|
32 |
|
|
ds@1990
|
33 |
#if defined _sdktools_trace_included |
|
ds@1990
|
34 |
#endinput |
|
ds@1990
|
35 |
#endif |
|
ds@1990
|
36 |
#define _sdktools_trace_included |
|
ds@1990
|
37 |
|
|
ds@1990
|
38 |
#define CONTENTS_EMPTY 0 /**< No contents. */ |
|
ds@1990
|
39 |
#define CONTENTS_SOLID 0x1 /**< an eye is never valid in a solid . */ |
|
ds@1990
|
40 |
#define CONTENTS_WINDOW 0x2 /**< translucent, but not watery (glass). */ |
|
ds@1990
|
41 |
#define CONTENTS_AUX 0x4 |
|
ds@1990
|
42 |
#define CONTENTS_GRATE 0x8 /**< alpha-tested "grate" textures. Bullets/sight pass through, but solids don't. */ |
|
ds@1990
|
43 |
#define CONTENTS_SLIME 0x10 |
|
ds@1990
|
44 |
#define CONTENTS_WATER 0x20 |
|
ds@1990
|
45 |
#define CONTENTS_MIST 0x40 |
|
ds@1990
|
46 |
#define CONTENTS_OPAQUE 0x80 /**< things that cannot be seen through (may be non-solid though). */ |
|
ds@1990
|
47 |
#define LAST_VISIBLE_CONTENTS 0x80 |
|
ds@1990
|
48 |
#define ALL_VISIBLE_CONTENTS (LAST_VISIBLE_CONTENTS | (LAST_VISIBLE_CONTENTS-1)) |
|
ds@1990
|
49 |
#define CONTENTS_TESTFOGVOLUME 0x100 |
|
ds@1990
|
50 |
#define CONTENTS_UNUSED5 0x200 |
|
ds@1990
|
51 |
#define CONTENTS_UNUSED6 0x4000 |
|
ds@1990
|
52 |
#define CONTENTS_TEAM1 0x800 /**< per team contents used to differentiate collisions. */ |
|
ds@1990
|
53 |
#define CONTENTS_TEAM2 0x1000 /**< between players and objects on different teams. */ |
|
ds@1990
|
54 |
#define CONTENTS_IGNORE_NODRAW_OPAQUE 0x2000 /**< ignore CONTENTS_OPAQUE on surfaces that have SURF_NODRAW. */ |
|
ds@1990
|
55 |
#define CONTENTS_MOVEABLE 0x4000 /**< hits entities which are MOVETYPE_PUSH (doors, plats, etc) */ |
|
ds@1990
|
56 |
#define CONTENTS_AREAPORTAL 0x8000 /**< remaining contents are non-visible, and don't eat brushes. */ |
|
ds@1990
|
57 |
#define CONTENTS_PLAYERCLIP 0x10000 |
|
ds@1990
|
58 |
#define CONTENTS_MONSTERCLIP 0x20000 |
|
ds@1990
|
59 |
|
|
ds@1990
|
60 |
/** |
|
ds@1990
|
61 |
* @section currents can be added to any other contents, and may be mixed |
|
ds@1990
|
62 |
*/ |
|
ds@1990
|
63 |
#define CONTENTS_CURRENT_0 0x40000 |
|
ds@1990
|
64 |
#define CONTENTS_CURRENT_90 0x80000 |
|
ds@1990
|
65 |
#define CONTENTS_CURRENT_180 0x100000 |
|
ds@1990
|
66 |
#define CONTENTS_CURRENT_270 0x200000 |
|
ds@1990
|
67 |
#define CONTENTS_CURRENT_UP 0x400000 |
|
ds@1990
|
68 |
#define CONTENTS_CURRENT_DOWN 0x800000 |
|
ds@1990
|
69 |
|
|
ds@1990
|
70 |
/** |
|
ds@1990
|
71 |
* @endsection |
|
ds@1990
|
72 |
*/ |
|
ds@1990
|
73 |
|
|
ds@1990
|
74 |
#define CONTENTS_ORIGIN 0x1000000 /**< removed before bsping an entity. */ |
|
ds@1990
|
75 |
#define CONTENTS_MONSTER 0x2000000 /**< should never be on a brush, only in game. */ |
|
ds@1990
|
76 |
#define CONTENTS_DEBRIS 0x4000000 |
|
ds@1990
|
77 |
#define CONTENTS_DETAIL 0x8000000 /**< brushes to be added after vis leafs. */ |
|
ds@1990
|
78 |
#define CONTENTS_TRANSLUCENT 0x10000000 /**< auto set if any surface has trans. */ |
|
ds@1990
|
79 |
#define CONTENTS_LADDER 0x20000000 |
|
ds@1990
|
80 |
#define CONTENTS_HITBOX 0x40000000 /**< use accurate hitboxes on trace. */ |
|
ds@1990
|
81 |
|
|
ds@1990
|
82 |
/** |
|
ds@1990
|
83 |
* @section Trace masks. |
|
ds@1990
|
84 |
*/ |
|
ds@1990
|
85 |
#define MASK_ALL (0xFFFFFFFF) |
|
ds@1990
|
86 |
#define MASK_SOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< everything that is normally solid */ |
|
ds@1990
|
87 |
#define MASK_PLAYERSOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_PLAYERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< everything that blocks player movement */ |
|
ds@1990
|
88 |
#define MASK_NPCSOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< blocks npc movement */ |
|
ds@1990
|
89 |
#define MASK_WATER (CONTENTS_WATER|CONTENTS_MOVEABLE|CONTENTS_SLIME) /**< water physics in these contents */ |
|
ds@1990
|
90 |
#define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_OPAQUE) /**< everything that blocks line of sight for AI, lighting, etc */ |
|
ds@1990
|
91 |
#define MASK_OPAQUE_AND_NPCS (MASK_OPAQUE|CONTENTS_MONSTER) /**< everything that blocks line of sight for AI, lighting, etc, but with monsters added. */ |
|
ds@1990
|
92 |
#define MASK_VISIBLE (MASK_OPAQUE|CONTENTS_IGNORE_NODRAW_OPAQUE) /**< everything that blocks line of sight for players */ |
|
ds@1990
|
93 |
#define MASK_VISIBLE_AND_NPCS (MASK_OPAQUE_AND_NPCS|CONTENTS_IGNORE_NODRAW_OPAQUE) /**< everything that blocks line of sight for players, but with monsters added. */ |
|
ds@1990
|
94 |
#define MASK_SHOT (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_HITBOX) /**< bullets see these as solid */ |
|
ds@1990
|
95 |
#define MASK_SHOT_HULL (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_GRATE) /**< non-raycasted weapons see this as solid (includes grates) */ |
|
ds@1990
|
96 |
#define MASK_SHOT_PORTAL (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW) /**< hits solids (not grates) and passes through everything else */ |
|
ds@1990
|
97 |
#define MASK_SOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_GRATE) /**< everything normally solid, except monsters (world+brush only) */ |
|
ds@1990
|
98 |
#define MASK_PLAYERSOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_PLAYERCLIP|CONTENTS_GRATE) /**< everything normally solid for player movement, except monsters (world+brush only) */ |
|
ds@1990
|
99 |
#define MASK_NPCSOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP|CONTENTS_GRATE) /**< everything normally solid for npc movement, except monsters (world+brush only) */ |
|
ds@1990
|
100 |
#define MASK_NPCWORLDSTATIC (CONTENTS_SOLID|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP|CONTENTS_GRATE) /**< just the world, used for route rebuilding */ |
|
ds@1990
|
101 |
#define MASK_SPLITAREAPORTAL (CONTENTS_WATER|CONTENTS_SLIME) /**< These are things that can split areaportals */ |
|
ds@1990
|
102 |
|
|
ds@1990
|
103 |
/** |
|
ds@1990
|
104 |
* @endsection |
|
ds@1990
|
105 |
*/ |
|
ds@1990
|
106 |
|
|
ds@1990
|
107 |
enum RayType |
|
ds@1990
|
108 |
{ |
|
ds@1990
|
109 |
RayType_EndPoint, /**< The trace ray will go from the start position to the end position. */ |
|
ds@1990
|
110 |
RayType_Infinite /**< The trace ray will go from the start position to infinity using a direction vector. */ |
|
ds@1990
|
111 |
}; |
|
ds@1990
|
112 |
|
|
ds@1990
|
113 |
funcenum TraceEntityFilter |
|
ds@1990
|
114 |
{ |
|
ds@1990
|
115 |
/** |
|
ds@1990
|
116 |
* Called on entity filtering. |
|
ds@1990
|
117 |
* |
|
ds@1990
|
118 |
* @param entity Entity index. |
|
ds@1990
|
119 |
* @param contentsMask Contents Mask. |
|
ds@1990
|
120 |
* @return True to allow the current entity to be hit, otherwise false. |
|
ds@1990
|
121 |
*/ |
|
ds@1990
|
122 |
bool:public(entity, contentsMask), |
|
ds@1990
|
123 |
|
|
ds@1990
|
124 |
/** |
|
ds@1990
|
125 |
* Called on entity filtering. |
|
ds@1990
|
126 |
* |
|
ds@1990
|
127 |
* @param entity Entity index. |
|
ds@1990
|
128 |
* @param contentsMask Contents Mask. |
|
ds@1990
|
129 |
* @param data Data value, if used. |
|
ds@1990
|
130 |
* @return True to allow the current entity to be hit, otherwise false. |
|
ds@1990
|
131 |
*/ |
|
ds@1990
|
132 |
bool:public(entity, contentsMask, any:data), |
|
ds@1990
|
133 |
}; |
|
ds@1990
|
134 |
|
|
ds@1990
|
135 |
/** |
|
ds@1990
|
136 |
* Get the contents mask and the entity index at the given position. |
|
ds@1990
|
137 |
* |
|
ds@1990
|
138 |
* @param pos World position to test. |
|
ds@1990
|
139 |
* @param entindex Entity index found at the given position (by reference). |
|
ds@1990
|
140 |
* @return Contents mask. |
|
ds@1990
|
141 |
*/ |
|
ds@1990
|
142 |
native TR_GetPointContents(const Float:pos[3], &entindex=-1); |
|
ds@1990
|
143 |
|
|
ds@1990
|
144 |
/** |
|
ds@1990
|
145 |
* Get the point contents testing only the given entity index. |
|
ds@1990
|
146 |
* |
|
ds@1990
|
147 |
* @param entindex Entity index to test. |
|
ds@1990
|
148 |
* @param pos World position. |
|
ds@1990
|
149 |
* @return Contents mask. |
|
ds@1990
|
150 |
*/ |
|
ds@1990
|
151 |
native TR_GetPointContentsEnt(entindex, const Float:pos[3]); |
|
ds@1990
|
152 |
|
|
ds@1990
|
153 |
/** |
|
ds@1990
|
154 |
* Starts up a new trace ray using a global trace result. |
|
ds@1990
|
155 |
* |
|
ds@1990
|
156 |
* @param pos Starting position of the ray. |
|
dvander@2089
|
157 |
* @param vec Depending on RayType, it will be used as the |
|
dvander@2089
|
158 |
* ending point, or the direction angle. |
|
ds@1990
|
159 |
* @param flags Trace flags. |
|
ds@1990
|
160 |
* @param rtype Method to calculate the ray direction. |
|
ds@1990
|
161 |
* @noreturn |
|
ds@1990
|
162 |
*/ |
|
dvander@2089
|
163 |
native TR_TraceRay(const Float:pos[3], |
|
dvander@2089
|
164 |
const Float:vec[3], |
|
dvander@2089
|
165 |
flags, |
|
dvander@2089
|
166 |
RayType:rtype); |
|
dvander@2089
|
167 |
|
|
dvander@2089
|
168 |
/** |
|
dvander@2089
|
169 |
* Starts up a new trace hull using a global trace result. |
|
dvander@2089
|
170 |
* |
|
dvander@2089
|
171 |
* @param pos Starting position of the ray. |
|
dvander@2089
|
172 |
* @param vec Ending position of the ray. |
|
dvander@2089
|
173 |
* @param mins Hull minimum size. |
|
dvander@2089
|
174 |
* @param maxs Hull maximum size. |
|
dvander@2089
|
175 |
* @param flags Trace flags. |
|
dvander@2089
|
176 |
* @noreturn |
|
dvander@2089
|
177 |
*/ |
|
dvander@2089
|
178 |
native TR_TraceHull(const Float:pos[3], |
|
dvander@2089
|
179 |
const Float:vec[3], |
|
dvander@2089
|
180 |
const Float:mins[3], |
|
dvander@2089
|
181 |
const Float:maxs[3], |
|
dvander@2089
|
182 |
flags); |
|
ds@1990
|
183 |
|
|
ds@1990
|
184 |
/** |
|
dvander@2089
|
185 |
* Starts up a new trace ray using a global trace result and a customized |
|
dvander@2089
|
186 |
* trace ray filter. |
|
ds@1990
|
187 |
* |
|
dvander@2089
|
188 |
* Calling TR_Trace*Filter or TR_Trace*FilterEx from inside a filter |
|
dvander@2089
|
189 |
* function is currently not allowed and may not work. |
|
ds@1990
|
190 |
* |
|
ds@1990
|
191 |
* @param pos Starting position of the ray. |
|
dvander@2089
|
192 |
* @param vec Depending on RayType, it will be used as the ending |
|
dvander@2089
|
193 |
* point, or the direction angle. |
|
ds@1990
|
194 |
* @param flags Trace flags. |
|
ds@1990
|
195 |
* @param rtype Method to calculate the ray direction. |
|
ds@1990
|
196 |
* @param filter Function to use as a filter. |
|
dvander@2089
|
197 |
* @param data Arbitrary data value to pass through to the filter |
|
dvander@2089
|
198 |
* function. |
|
ds@1990
|
199 |
* @noreturn |
|
ds@1990
|
200 |
*/ |
|
ds@1990
|
201 |
native TR_TraceRayFilter(const Float:pos[3], |
|
ds@1990
|
202 |
const Float:vec[3], |
|
ds@1990
|
203 |
flags, |
|
ds@1990
|
204 |
RayType:rtype, |
|
ds@1990
|
205 |
TraceEntityFilter:filter, |
|
ds@1990
|
206 |
any:data=0); |
|
dvander@2089
|
207 |
|
|
dvander@2089
|
208 |
/** |
|
dvander@2089
|
209 |
* Starts up a new trace hull using a global trace result and a customized |
|
dvander@2089
|
210 |
* trace ray filter. |
|
dvander@2089
|
211 |
* |
|
dvander@2089
|
212 |
* Calling TR_Trace*Filter or TR_Trace*FilterEx from inside a filter |
|
dvander@2089
|
213 |
* function is currently not allowed and may not work. |
|
dvander@2089
|
214 |
* |
|
dvander@2089
|
215 |
* @param pos Starting position of the ray. |
|
dvander@2089
|
216 |
* @param vec Depending on RayType, it will be used as the ending |
|
dvander@2089
|
217 |
* point, or the direction angle. |
|
dvander@2089
|
218 |
* @param mins Hull minimum size. |
|
dvander@2089
|
219 |
* @param maxs Hull maximum size. |
|
dvander@2089
|
220 |
* @param flags Trace flags. |
|
dvander@2089
|
221 |
* @param filter Function to use as a filter. |
|
dvander@2089
|
222 |
* @param data Arbitrary data value to pass through to the filter |
|
dvander@2089
|
223 |
* function. |
|
dvander@2089
|
224 |
* @noreturn |
|
dvander@2089
|
225 |
*/ |
|
dvander@2089
|
226 |
native TR_TraceHullFilter(const Float:pos[3], |
|
dvander@2089
|
227 |
const Float:vec[3], |
|
dvander@2089
|
228 |
const Float:mins[3], |
|
dvander@2089
|
229 |
const Float:maxs[3], |
|
dvander@2089
|
230 |
flags, |
|
dvander@2089
|
231 |
TraceEntityFilter:filter, |
|
dvander@2089
|
232 |
any:data=0); |
|
ds@1990
|
233 |
|
|
ds@1990
|
234 |
/** |
|
ds@1990
|
235 |
* Starts up a new trace ray using a new trace result. |
|
ds@1990
|
236 |
* |
|
ds@1990
|
237 |
* @param pos Starting position of the ray. |
|
dvander@2089
|
238 |
* @param vec Depending on RayType, it will be used as the ending |
|
dvander@2089
|
239 |
* point, or the direction angle. |
|
ds@1990
|
240 |
* @param flags Trace flags. |
|
ds@1990
|
241 |
* @param rtype Method to calculate the ray direction. |
|
ds@1990
|
242 |
* @return Ray trace handle, which must be closed via CloseHandle(). |
|
ds@1990
|
243 |
*/ |
|
dvander@2089
|
244 |
native Handle:TR_TraceRayEx(const Float:pos[3], |
|
dvander@2089
|
245 |
const Float:vec[3], |
|
dvander@2089
|
246 |
flags, |
|
dvander@2089
|
247 |
RayType:rtype); |
|
dvander@2089
|
248 |
|
|
dvander@2089
|
249 |
/** |
|
dvander@2089
|
250 |
* Starts up a new trace hull using a new trace result. |
|
dvander@2089
|
251 |
* |
|
dvander@2089
|
252 |
* @param pos Starting position of the ray. |
|
dvander@2089
|
253 |
* @param vec Ending position of the ray. |
|
dvander@2089
|
254 |
* @param mins Hull minimum size. |
|
dvander@2089
|
255 |
* @param maxs Hull maximum size. |
|
dvander@2089
|
256 |
* @param flags Trace flags. |
|
dvander@2089
|
257 |
* @return Ray trace handle, which must be closed via CloseHandle(). |
|
dvander@2089
|
258 |
*/ |
|
dvander@2089
|
259 |
native Handle:TR_TraceHullEx(const Float:pos[3], |
|
dvander@2089
|
260 |
const Float:vec[3], |
|
dvander@2089
|
261 |
const Float:mins[3], |
|
dvander@2089
|
262 |
const Float:maxs[3], |
|
dvander@2089
|
263 |
flags); |
|
ds@1990
|
264 |
|
|
ds@1990
|
265 |
/** |
|
dvander@2089
|
266 |
* Starts up a new trace ray using a new trace result and a customized |
|
dvander@2089
|
267 |
* trace ray filter. |
|
ds@1990
|
268 |
* |
|
dvander@2089
|
269 |
* Calling TR_Trace*Filter or TR_TraceRay*Ex from inside a filter |
|
dvander@2089
|
270 |
* function is currently not allowed and may not work. |
|
ds@1990
|
271 |
* |
|
ds@1990
|
272 |
* @param pos Starting position of the ray. |
|
dvander@2089
|
273 |
* @param vec Depending on RayType, it will be used as the ending |
|
dvander@2089
|
274 |
* point, or the direction angle. |
|
ds@1990
|
275 |
* @param flags Trace flags. |
|
ds@1990
|
276 |
* @param rtype Method to calculate the ray direction. |
|
ds@1990
|
277 |
* @param filter Function to use as a filter. |
|
ds@1990
|
278 |
* @param data Arbitrary data value to pass through to the filter function. |
|
ds@1990
|
279 |
* @return Ray trace handle, which must be closed via CloseHandle(). |
|
ds@1990
|
280 |
*/ |
|
ds@1990
|
281 |
native Handle:TR_TraceRayFilterEx(const Float:pos[3], |
|
ds@1990
|
282 |
const Float:vec[3], |
|
ds@1990
|
283 |
flags, |
|
ds@1990
|
284 |
RayType:rtype, |
|
ds@1990
|
285 |
TraceEntityFilter:filter, |
|
ds@1990
|
286 |
any:data=0); |
|
dvander@2089
|
287 |
|
|
dvander@2089
|
288 |
/** |
|
dvander@2089
|
289 |
* Starts up a new trace hull using a new trace result and a customized |
|
dvander@2089
|
290 |
* trace ray filter. |
|
dvander@2089
|
291 |
* |
|
dvander@2089
|
292 |
* Calling TR_Trace*Filter or TR_Trace*FilterEx from inside a filter |
|
dvander@2089
|
293 |
* function is currently not allowed and may not work. |
|
dvander@2089
|
294 |
* |
|
dvander@2089
|
295 |
* @param pos Starting position of the ray. |
|
dvander@2089
|
296 |
* @param vec Ending position of the ray. |
|
dvander@2089
|
297 |
* @param mins Hull minimum size. |
|
dvander@2089
|
298 |
* @param maxs Hull maximum size. |
|
dvander@2089
|
299 |
* @param flags Trace flags. |
|
dvander@2089
|
300 |
* @param filter Function to use as a filter. |
|
dvander@2089
|
301 |
* @param data Arbitrary data value to pass through to the filter function. |
|
dvander@2089
|
302 |
* @return Ray trace handle, which must be closed via CloseHandle(). |
|
dvander@2089
|
303 |
*/ |
|
dvander@2089
|
304 |
native Handle:TR_TraceHullFilterEx(const Float:pos[3], |
|
dvander@2089
|
305 |
const Float:vec[3], |
|
dvander@2089
|
306 |
const Float:mins[3], |
|
dvander@2089
|
307 |
const Float:maxs[3], |
|
dvander@2089
|
308 |
flags, |
|
dvander@2089
|
309 |
TraceEntityFilter:filter, |
|
dvander@2089
|
310 |
any:data=0); |
|
ds@1990
|
311 |
|
|
ds@1990
|
312 |
/** |
|
ds@1990
|
313 |
* Returns the time fraction from a trace result (1.0 means no collision). |
|
ds@1990
|
314 |
* |
|
ds@1990
|
315 |
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result. |
|
ds@1990
|
316 |
* @return Time fraction value of the trace. |
|
ds@1990
|
317 |
* @error Invalid Handle. |
|
ds@1990
|
318 |
*/ |
|
ds@1990
|
319 |
native Float:TR_GetFraction(Handle:hndl=INVALID_HANDLE); |
|
ds@1990
|
320 |
|
|
ds@1990
|
321 |
/** |
|
ds@1990
|
322 |
* Returns the collision position of a trace result. |
|
ds@1990
|
323 |
* |
|
ds@1990
|
324 |
* @param pos Vector buffer to store data in. |
|
ds@1990
|
325 |
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result. |
|
ds@1990
|
326 |
* @noreturn |
|
ds@1990
|
327 |
* @error Invalid Handle. |
|
ds@1990
|
328 |
*/ |
|
ds@1990
|
329 |
native TR_GetEndPosition(Float:pos[3], Handle:hndl=INVALID_HANDLE); |
|
ds@1990
|
330 |
|
|
ds@1990
|
331 |
/** |
|
ds@1990
|
332 |
* Returns the entity index that collided with the trace. |
|
ds@1990
|
333 |
* |
|
ds@1990
|
334 |
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result. |
|
ds@1990
|
335 |
* @return Entity index or -1 for no collision. |
|
ds@1990
|
336 |
* @error Invalid Handle. |
|
ds@1990
|
337 |
*/ |
|
ds@1990
|
338 |
native TR_GetEntityIndex(Handle:hndl=INVALID_HANDLE); |
|
ds@1990
|
339 |
|
|
ds@1990
|
340 |
/** |
|
ds@1990
|
341 |
* Returns if there was any kind of collision along the trace ray. |
|
ds@1990
|
342 |
* |
|
ds@1990
|
343 |
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result. |
|
ds@1990
|
344 |
* @return True if any collision found, otherwise false. |
|
ds@1990
|
345 |
* @error Invalid Handle. |
|
ds@1990
|
346 |
*/ |
|
ds@1990
|
347 |
native bool:TR_DidHit(Handle:hndl=INVALID_HANDLE); |
|
ds@1990
|
348 |
|
|
ds@1990
|
349 |
/** |
|
ds@1990
|
350 |
* Returns in which body hit group the trace collided if any. |
|
ds@1990
|
351 |
* |
|
ds@1990
|
352 |
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result. |
|
ds@1990
|
353 |
* @return Body hit group. |
|
ds@1990
|
354 |
* @error Invalid Handle. |
|
ds@1990
|
355 |
*/ |
|
ds@1990
|
356 |
native TR_GetHitGroup(Handle:hndl=INVALID_HANDLE); |
|
ds@1990
|
357 |
|
|
ds@1990
|
358 |
/** |
|
ds@1990
|
359 |
* Find the normal vector to the collison plane of a trace. |
|
ds@1990
|
360 |
* |
|
ds@1990
|
361 |
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result. |
|
ds@1990
|
362 |
* @param normal Vector buffer to store the vector normal to the collision plane |
|
ds@1990
|
363 |
* @noreturn |
|
ds@1990
|
364 |
* @error Invalid Handle |
|
ds@1990
|
365 |
*/ |
|
ds@1990
|
366 |
native TR_GetPlaneNormal(Handle:hndl, Float:normal[3]); |
|
ds@1990
|
367 |
|
|
the_dafox@2780
|
368 |
/** |
|
the_dafox@2780
|
369 |
* Tests a point to see if it's outside any playable area |
|
the_dafox@2780
|
370 |
* |
|
the_dafox@2780
|
371 |
* @param pos Vector buffer to store data in. |
|
the_dafox@2780
|
372 |
* @return True if outside world, otherwise false. |
|
the_dafox@2780
|
373 |
*/ |
|
the_dafox@2780
|
374 |
native TR_PointOutsideWorld(Float:pos[3]); |