OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
navigation_recast_load_ext.h
1/*
2===========================================================================
3Copyright (C) 2025 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, 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
34struct rcPolyMesh;
35
40struct 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
62class INavigationMapExtension : public Class
63{
64private:
65 CLASS_PROTOTYPE(INavigationMapExtension);
66
67public:
68 virtual void Handle(Container<offMeshNavigationPoint>& points, const rcPolyMesh *polyMesh) {};
69};
70
72{
73private:
74 CLASS_PROTOTYPE(NavigationMapExtension_Ladders);
75
76public:
77 void Handle(Container<offMeshNavigationPoint>& points, const rcPolyMesh *polyMesh) override;
78};
79
81{
82private:
83 CLASS_PROTOTYPE(NavigationMapExtension_JumpFall);
84
85public:
86 void Handle(Container<offMeshNavigationPoint>& points, const rcPolyMesh *polyMesh) override;
87
88private:
89 void FixupPoint(vec3_t pos);
90 offMeshNavigationPoint CanConnectFallPoint(const rcPolyMesh *polyMesh, const Vector& pos1, const Vector& pos2);
91 offMeshNavigationPoint CanConnectJumpPoint(const rcPolyMesh *polyMesh, const Vector& pos1, const Vector& pos2);
92 offMeshNavigationPoint CanConnectStraightPoint(const rcPolyMesh *polyMesh, const Vector& pos1, const Vector& pos2);
93};
Definition container.h:85
Definition navigation_recast_load_ext.h:63
Definition navigation_recast_load_ext.h:81
Definition navigation_recast_load_ext.h:72
Definition vector.h:61
An offmesh point that the navigation system will use to find path.
Definition navigation_recast_load_ext.h:40