2023-01-13 22:04:30 +01:00
|
|
|
#ifndef GSAI_FOLLOW_PATH_H
|
|
|
|
#define GSAI_FOLLOW_PATH_H
|
2023-01-13 21:13:57 +01:00
|
|
|
|
|
|
|
class GSAIFollowPath : public GSAIArrive {
|
2023-01-13 21:35:07 +01:00
|
|
|
GDCLASS(GSAIFollowPath, GSAIArrive);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
public:
|
|
|
|
GSAIPath get_ *path();
|
|
|
|
void set_ *path(const GSAIPath &val);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
float get_path_offset() const;
|
|
|
|
void set_path_offset(const float val);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
bool get_is_arrive_enabled() const;
|
|
|
|
void set_is_arrive_enabled(const bool val);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
float get_prediction_time() const;
|
|
|
|
void set_prediction_time(const float val);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
void _calculate_steering(const GSAITargetAcceleration &acceleration);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
GSAIFollowPath();
|
|
|
|
~GSAIFollowPath();
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
// Produces a linear acceleration that moves the agent along the specified path.
|
|
|
|
// @category - Individual behaviors
|
|
|
|
// The path to follow and travel along.
|
|
|
|
GSAIPath *path;
|
|
|
|
// The distance along the path to generate the next target position.
|
|
|
|
float path_offset = 0.0;
|
|
|
|
// Whether to use `GSAIArrive` behavior on an open path.
|
|
|
|
bool is_arrive_enabled = true;
|
|
|
|
// The amount of time in the future to predict the owning agent's position along
|
|
|
|
// the path. Setting it to 0.0 will force non-predictive path following.
|
|
|
|
float prediction_time = 0.0;
|
2023-01-13 21:13:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|