27 lines
552 B
C++
27 lines
552 B
C++
#ifndef PATROL_PATH_H
|
|
#define PATROL_PATH_H
|
|
|
|
#include "scene/3d/node_3d.h"
|
|
|
|
class PatrolPath : public Node3D {
|
|
GDCLASS(PatrolPath, Node3D);
|
|
static void _bind_methods();
|
|
void child_added(Node *child);
|
|
void child_removed(Node *child);
|
|
void enter_tree();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
public:
|
|
int point_count() const;
|
|
Vector3 point_at(int &index) const;
|
|
Vector3 point_at_unchecked(int const index) const;
|
|
Vector3 get_closest_point(Vector3 global_position, int *idx);
|
|
|
|
private:
|
|
Vector<Node3D *> path{};
|
|
};
|
|
|
|
#endif // !PATROL_PATH_H
|