/
p_linedef.h
134 lines (118 loc) · 5.11 KB
/
p_linedef.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**\file p_linedef.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2012 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2006-2012 Daniel Swanson <danij@dengine.net>
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
/**
* Map LineDef
*/
#ifndef LIBDENG_MAP_LINEDEF_H
#define LIBDENG_MAP_LINEDEF_H
#include "r_data.h"
#include "p_dmu.h"
/**
* Update the LineDef's slopetype and map space angle delta according to
* the points defined by it's vertices.
*
* @param lineDef LineDef instance.
*/
void LineDef_UpdateSlope(linedef_t* lineDef);
/**
* Update the LineDef's map space axis-aligned bounding box to encompass
* the points defined by it's vertices.
*
* @param lineDef LineDef instance.
*/
void LineDef_UpdateAABox(linedef_t* lineDef);
/**
* @return Minimal floor Plane which interfaces with this LineDef's face.
* If both front and back floor Plane interfaces exist and are equal,
* the front Plane is returned. May return @c NULL if no interfaces.
*/
plane_t* LineDef_FloorMin(const linedef_t* lineDef);
/**
* @return Maximal floor Plane which interfaces with this LineDef's face.
* If both front and back floor Plane interfaces exist and are equal,
* the front Plane is returned. May return @c NULL if no interfaces.
*/
plane_t* LineDef_FloorMax(const linedef_t* lineDef);
/**
* @return Minimal ceiling Plane which interfaces with this LineDef's face.
* If both front and back ceiling Plane interfaces exist and are equal,
* the front Plane is returned. May return @c NULL if no interfaces.
*/
plane_t* LineDef_CeilingMin(const linedef_t* lineDef);
/**
* @return Maximal ceiling Plane which interfaces with this LineDef's face.
* If both front and back ceiling Plane interfaces exist and are equal,
* the front Plane is returned. May return @c NULL if no interfaces.
*/
plane_t* LineDef_CeilingMax(const linedef_t* lineDef);
/**
* @param ignoreOpacity @c true= do not consider Material opacity.
* @return @c true if this LineDef's side is considered "closed" (i.e.,
* there is no opening through which the back Sector can be seen).
* Tests consider all Planes which interface with this and the "middle"
* Material used on the relative front side (if any).
*/
boolean LineDef_BackClosed(const linedef_t* lineDef, int side, boolean ignoreOpacity);
/**
* The DOOM lighting model applies a sector light level delta when drawing
* Segs based on their 2D world angle.
*
* @param lineDef LineDef to calculate delta for.
* @param side Side of the LineDef we are interested in.
* @param deltaL Light delta for the left edge written here.
* @param deltaR Light delta for the right edge written here.
*/
void LineDef_LightLevelDelta(const linedef_t* lineDef, int side, float* deltaL, float* deltaR);
/**
* @param lineDef LineDef being tested.
* @param side Side of LineDef to test. Non-zero values signify the BACK side.
* @return @c true iff the SideDef on the referenced @a lineDef @a side has
* a "middle" Material which completely covers any opening (gap between
* floor and ceiling planes) on that side of the line.
*/
boolean LineDef_MiddleMaterialCoversOpening(const linedef_t* lineDef, int side, boolean ignoreAlpha);
/**
* Calculate coordinates for a "middle" Material if present.
*
* @param lineDef LineDef to calculate for.
* @param side Side of the LineDef we are interested in.
* @param bottomLeft Z map space coordinate of the bottom left of the Material written here.
* @param bottomRight Z map space coordinate of the bottom right of the Material written here.
* @param topLeft Z map space coordinate of the top left of the Material written here.
* @param topRight Z map space coordinate of the top right of the Material written here.
* @param texOffY Offset to the top of the Material written here.
* @return @c true iff the middle Material is visible (in the opening).
*/
int LineDef_MiddleMaterialCoords(const linedef_t* lineDef, int side,
float* bottomLeft, float* bottomRight, float* topLeft, float* topRight, float* texOffY,
boolean lowerUnpeg, boolean clipTop, boolean clipBottom);
/**
* Get the value of a linedef property, selected by DMU_* name.
*/
int LineDef_GetProperty(const linedef_t* lineDef, setargs_t* args);
/**
* Update the linedef, property is selected by DMU_* name.
*/
int LineDef_SetProperty(linedef_t* lineDef, const setargs_t* args);
#endif /* LIBDENG_MAP_LINEDEF_H */