34 lines
910 B
C++
34 lines
910 B
C++
#ifndef NAV_ROOM_HPP
|
|
#define NAV_ROOM_HPP
|
|
|
|
#include <godot_cpp/classes/node3d.hpp>
|
|
#include <godot_cpp/templates/vector.hpp>
|
|
|
|
namespace gd = godot;
|
|
|
|
class NavMarker;
|
|
|
|
class NavRoom : public gd::Node3D {
|
|
GDCLASS(NavRoom, gd::Node3D);
|
|
static void _bind_methods();
|
|
public:
|
|
static NavRoom *get_closest_room(gd::Vector3 const &closest_to);
|
|
virtual void _enter_tree() override;
|
|
virtual void _exit_tree() override;
|
|
virtual void on_child_entered(gd::Node *child);
|
|
gd::Vector<NavRoom*> const &get_neighbours() const;
|
|
gd::Vector<NavMarker*> const &get_markers() const;
|
|
private:
|
|
void set_editor_neighbours(gd::Array array);
|
|
gd::Array get_editor_neighbours() const;
|
|
private:
|
|
float radius{1.f};
|
|
gd::Vector3 centre{0.f, 0.f, 0.f};
|
|
gd::Vector<NavMarker*> markers{};
|
|
gd::Vector<NavRoom*> neighbours{};
|
|
|
|
static gd::Vector<NavRoom*> rooms;
|
|
};
|
|
|
|
#endif // !NAV_ROOM_HPP
|