2023-01-05 12:25:55 +00:00
|
|
|
/**************************************************************************/
|
2023-02-01 21:11:10 +00:00
|
|
|
/* nav_agent.h */
|
2023-01-05 12:25:55 +00:00
|
|
|
/**************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
|
|
|
/* https://godotengine.org */
|
|
|
|
/**************************************************************************/
|
|
|
|
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
|
|
|
|
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/**************************************************************************/
|
2017-02-28 12:10:29 +00:00
|
|
|
|
2023-02-01 21:11:10 +00:00
|
|
|
#ifndef NAV_AGENT_H
|
|
|
|
#define NAV_AGENT_H
|
2020-01-10 11:22:34 +00:00
|
|
|
|
2020-11-07 22:33:38 +00:00
|
|
|
#include "core/object/class_db.h"
|
2020-01-10 11:22:34 +00:00
|
|
|
#include "nav_rid.h"
|
2020-10-15 15:29:59 +00:00
|
|
|
|
2020-01-10 11:22:34 +00:00
|
|
|
#include <Agent.h>
|
|
|
|
|
|
|
|
class NavMap;
|
|
|
|
|
2023-02-01 21:11:10 +00:00
|
|
|
class NavAgent : public NavRid {
|
2020-05-12 15:01:17 +00:00
|
|
|
NavMap *map = nullptr;
|
2020-01-10 11:22:34 +00:00
|
|
|
RVO::Agent agent;
|
2023-01-28 04:15:10 +00:00
|
|
|
Callable callback = Callable();
|
2021-02-08 09:57:18 +00:00
|
|
|
uint32_t map_update_id = 0;
|
2020-01-10 11:22:34 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
void set_map(NavMap *p_map);
|
|
|
|
NavMap *get_map() {
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
|
|
|
|
RVO::Agent *get_agent() {
|
|
|
|
return &agent;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool is_map_changed();
|
|
|
|
|
2023-01-28 04:15:10 +00:00
|
|
|
void set_callback(Callable p_callback);
|
2020-01-10 11:22:34 +00:00
|
|
|
bool has_callback() const;
|
|
|
|
|
|
|
|
void dispatch_callback();
|
|
|
|
};
|
|
|
|
|
2023-02-01 21:11:10 +00:00
|
|
|
#endif // NAV_AGENT_H
|