75 std::vector<std::reference_wrapper<GameObject>>&
get_path();
86 const Vector3& world_position)
const;
104 std::vector<std::reference_wrapper<GameObject>> path_;
105 std::optional<Vector3> origin_;
106 std::optional<Vector3> target_;
107 std::optional<std::reference_wrapper<GameObject>> target_game_object_;
109 std::reference_wrapper<NavigationGraph> get_navigation_graph_component()
Base class for all components that can be attached to GameObjects.
Definition component.h:24
Concept to constrain types to be derived from Component.
Definition gameObject.h:33
Component responsible for AI pathfinding using a navigation graph.
Definition pathfinding.h:26
std::optional< Vector3 > get_origin() const
Getters and Setters for origin (positions)
void update(float dt) override
Update is left empty as the pathfinding component does not require per-frame updates.
Definition pathfinding.h:32
Pathfinding & generate_path_to_target()
Pathfinding & set_origin(Vector3 origin)
std::vector< std::reference_wrapper< GameObject > > & get_path()
Retrieves the current path of the AI agent.
std::string type_name() const override
Provides a consistent type name for the component.
Pathfinding & generate_path_to_position()
std::optional< GraphPosition > find_closest_node(const Vector3 &world_position) const
Finds the closest navigation node to the specified world position.
Pathfinding & set_target_game_object(GameObject &target)
Pathfinding & generate_path_to_position(Vector3 origin, Vector3 target)
Generates a path to the specified target GameObject.
std::optional< std::reference_wrapper< GameObject > > get_target_game_object() const
Getters and Setters for target (GameObject)
Pathfinding & generate_path_to_target_game_object()
Generates a path to the current target GameObject using the A* algorithm.
Pathfinding & set_target(Vector3 target)
Pathfinding & generate_path_to_target(Vector3 origin)
Generates a path to the target GameObject using the A* algorithm.
std::optional< Vector3 > get_target() const
Getters and Setters for target (positions)
Represents a 3D vector with x, y, and z components. This class provides basic vector operations such ...
Definition vector3.h:8
Structure representing a position in the navigation graph.
Definition graph.h:29