OpenMoHAA
0.82.1
Loading...
Searching...
No Matches
navigation_recast_load_ext.h
1
/*
2
===========================================================================
3
Copyright (C) 2025 the OpenMoHAA team
4
5
This file is part of OpenMoHAA source code.
6
7
OpenMoHAA source code is free software; you can redistribute it
8
and/or modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of the License,
10
or (at your option) any later version.
11
12
OpenMoHAA source code is distributed in the hope that it will be
13
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with OpenMoHAA source code; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
===========================================================================
21
*/
22
27
28
#pragma once
29
30
#include "../qcommon/class.h"
31
#include "../qcommon/vector.h"
32
#include "../qcommon/container.h"
33
34
struct
rcPolyMesh;
35
40
struct
offMeshNavigationPoint {
41
Vector
start;
42
Vector
end;
43
float
radius;
44
unsigned
short
flags;
45
unsigned
char
area;
46
bool
bidirectional;
47
int
id;
48
49
offMeshNavigationPoint()
50
: radius(0)
51
, flags(0)
52
, area(0)
53
, bidirectional(
true
)
54
, id(0)
55
{}
56
57
bool
operator==(
const
offMeshNavigationPoint& other)
const
{
return
start == other.start && end == other.end; }
58
59
bool
operator!=(
const
offMeshNavigationPoint& other)
const
{
return
!(*
this
== other); }
60
};
61
62
struct
ExtensionArea {
63
float
cost;
64
unsigned
char
number;
65
66
ExtensionArea(
unsigned
char
number,
float
cost)
67
{
68
this->number = number;
69
this->cost = cost;
70
}
71
};
72
73
class
INavigationMapExtension
:
public
Class
74
{
75
private
:
76
CLASS_PROTOTYPE(
INavigationMapExtension
);
77
78
public
:
79
virtual
void
Handle(
Container<offMeshNavigationPoint>
& points,
const
rcPolyMesh *polyMesh) {}
80
81
virtual
Container<ExtensionArea>
GetSupportedAreas()
const
{
return
Container<ExtensionArea>
(); }
82
};
83
84
class
NavigationMapExtension_Ladders
:
public
INavigationMapExtension
85
{
86
private
:
87
CLASS_PROTOTYPE(
NavigationMapExtension_Ladders
);
88
89
public
:
90
void
Handle(
Container<offMeshNavigationPoint>
& points,
const
rcPolyMesh *polyMesh)
override
;
91
Container<ExtensionArea>
GetSupportedAreas()
const override
;
92
};
93
94
class
NavigationMapExtension_JumpFall
:
public
INavigationMapExtension
95
{
96
private
:
97
CLASS_PROTOTYPE(
NavigationMapExtension_JumpFall
);
98
99
public
:
100
void
Handle(
Container<offMeshNavigationPoint>
& points,
const
rcPolyMesh *polyMesh)
override
;
101
Container<ExtensionArea>
GetSupportedAreas()
const override
;
102
103
private
:
104
void
FixupPoint(vec3_t pos);
105
bool
AddPoint(
Container<offMeshNavigationPoint>
& points,
const
offMeshNavigationPoint
& point);
106
bool
AreVertsValid(
const
vec3_t pos1,
const
vec3_t pos2)
const
;
107
offMeshNavigationPoint
CanConnectFallPoint(
const
rcPolyMesh *polyMesh,
const
Vector
& pos1,
const
Vector
& pos2);
108
offMeshNavigationPoint
CanConnectJumpPoint(
const
rcPolyMesh *polyMesh,
const
Vector
& pos1,
const
Vector
& pos2);
109
offMeshNavigationPoint
CanConnectJumpOverLedgePoint(
const
rcPolyMesh *polyMesh,
const
Vector
& pos1,
const
Vector
& pos2);
110
offMeshNavigationPoint
CanConnectStraightPoint(
const
rcPolyMesh *polyMesh,
const
Vector
& pos1,
const
Vector
& pos2);
111
};
Container
Definition
container.h:85
INavigationMapExtension
Definition
navigation_recast_load_ext.h:74
NavigationMapExtension_JumpFall
Definition
navigation_recast_load_ext.h:95
NavigationMapExtension_Ladders
Definition
navigation_recast_load_ext.h:85
Vector
Definition
vector.h:61
offMeshNavigationPoint
An offmesh point that the navigation system will use to find path.
Definition
navigation_recast_load_ext.h:40
code
fgame
navigation_recast_load_ext.h
Generated by
1.13.2