/
p_intercept.h
50 lines (43 loc) · 1.83 KB
/
p_intercept.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/** @file p_intercept.h World map line / object interception.
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2006-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
*/
#ifndef DENG_WORLD_P_INTERCEPT_H
#define DENG_WORLD_P_INTERCEPT_H
class Line;
struct InterceptNode; // The interceptnode instance (opaque).
typedef struct InterceptNode InterceptNode;
/**
* Empties the intercepts array and makes sure it has been allocated.
*/
void P_ClearIntercepts();
/**
* You must clear intercepts before the first time this is called.
* The intercepts array grows if necessary.
*
* @param type Type of interception.
* @param distance Distance along the trace vector that the interception occured [0...1].
* @param object Object being intercepted.
*
* @return Newly added intercept or @c NULL if outside the trace range.
*/
InterceptNode *P_AddIntercept(intercepttype_t type, float distance, void *object);
/**
* @return Zero if the traverser callback returns zero for all processed intercepts.
*/
int P_TraverseIntercepts(traverser_t callback, void *parameters);
#endif // DENG_WORLD_P_INTERCEPT_H