OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
navigation_legacy_path.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
23#pragma once
24
25#include "navigation_path.h"
26#include "actorpath.h"
27
34class LegacyPather : public IPather
35{
36public:
37 virtual void FindPath(const Vector& start, const Vector& end, const PathSearchParameter& parameters) override;
38 virtual void
39 FindPathNear(const Vector& start, const Vector& end, float radius, const PathSearchParameter& parameters) override;
40 virtual void FindPathAway(
41 const Vector& start,
42 const Vector& avoid,
43 const Vector& preferredDir,
44 float radius,
45 const PathSearchParameter& parameters
46 ) override;
47 virtual bool TestPath(const Vector& start, const Vector& end, const PathSearchParameter& parameters) override;
48
49 virtual void UpdatePos(const Vector& origin) override;
50 virtual void Clear() override;
51
52 virtual PathNav GetNode(unsigned int index) const override;
53 virtual int GetNodeCount() const override;
54 virtual Vector GetCurrentDelta() const override;
55 virtual Vector GetCurrentDirection() const override;
56 virtual Vector GetDestination() const override;
57 virtual bool HasReachedGoal(const Vector& origin) const override;
58 virtual bool IsQuerying() const override;
59
60private:
61 ActorPath path;
62};
Definition actorpath.h:34
Definition navigation_path.h:43
Legacy navigation system.
Definition navigation_legacy_path.h:35
virtual void FindPathNear(const Vector &start, const Vector &end, float radius, const PathSearchParameter &parameters) override
Find and set the path from start to end with the specified goal radius.
Definition navigation_legacy_path.cpp:39
virtual void FindPathAway(const Vector &start, const Vector &avoid, const Vector &preferredDir, float radius, const PathSearchParameter &parameters) override
Find and set the path away from the specified origin.
Definition navigation_legacy_path.cpp:47
virtual void Clear() override
Clear the path.
Definition navigation_legacy_path.cpp:77
virtual void UpdatePos(const Vector &origin) override
Update path movement.
Definition navigation_legacy_path.cpp:72
virtual bool HasReachedGoal(const Vector &origin) const override
Return true if the origin is at the end of the goal.
Definition navigation_legacy_path.cpp:143
virtual void FindPath(const Vector &start, const Vector &end, const PathSearchParameter &parameters) override
Find and set the path from start to end.
Definition navigation_legacy_path.cpp:33
virtual Vector GetDestination() const override
Return the final destination.
Definition navigation_legacy_path.cpp:134
virtual bool TestPath(const Vector &start, const Vector &end, const PathSearchParameter &parameters) override
Returns true if the path exists, false otherwise.
Definition navigation_legacy_path.cpp:67
virtual int GetNodeCount() const override
Return the number of nodes.
Definition navigation_legacy_path.cpp:113
virtual bool IsQuerying() const override
Return true if the path is currently being calculated.
Definition navigation_legacy_path.cpp:148
virtual Vector GetCurrentDelta() const override
Return the current move delta.
Definition navigation_legacy_path.cpp:122
virtual Vector GetCurrentDirection() const override
Return the directional vector towards the path.
Definition navigation_legacy_path.cpp:128
virtual PathNav GetNode(unsigned int index) const override
Return the node at the specified index (0 = first node, and nodecount - 1 = last node).
Definition navigation_legacy_path.cpp:83
Definition vector.h:61
Definition navigation_path.h:29
Definition navigation_path.h:35