2023-01-13 22:04:30 +01:00
|
|
|
#ifndef GSAI_STEERING_AGENT_H
|
|
|
|
#define GSAI_STEERING_AGENT_H
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 23:01:38 +01:00
|
|
|
#include "core/int_types.h"
|
|
|
|
#include "core/math/vector3.h"
|
|
|
|
|
|
|
|
#include "core/object/reference.h"
|
|
|
|
|
|
|
|
#include "gsai_agent_location.h"
|
|
|
|
|
2023-01-13 21:13:57 +01:00
|
|
|
class GSAISteeringAgent : public GSAIAgentLocation {
|
2023-01-13 21:35:07 +01:00
|
|
|
GDCLASS(GSAISteeringAgent, GSAIAgentLocation);
|
|
|
|
|
|
|
|
public:
|
|
|
|
float get_zero_linear_speed_threshold() const;
|
|
|
|
void set_zero_linear_speed_threshold(const float val);
|
|
|
|
|
|
|
|
float get_linear_speed_max() const;
|
|
|
|
void set_linear_speed_max(const float val);
|
|
|
|
|
|
|
|
float get_linear_acceleration_max() const;
|
|
|
|
void set_linear_acceleration_max(const float val);
|
|
|
|
|
|
|
|
float get_angular_speed_max() const;
|
|
|
|
void set_angular_speed_max(const float val);
|
|
|
|
|
|
|
|
float get_angular_acceleration_max() const;
|
|
|
|
void set_angular_acceleration_max(const float val);
|
|
|
|
|
|
|
|
Vector3 get_linear_velocity();
|
|
|
|
void set_linear_velocity(const Vector3 &val);
|
|
|
|
|
|
|
|
float get_angular_velocity() const;
|
|
|
|
void set_angular_velocity(const float val);
|
|
|
|
|
|
|
|
float get_bounding_radius() const;
|
|
|
|
void set_bounding_radius(const float val);
|
|
|
|
|
|
|
|
bool get_is_tagged() const;
|
|
|
|
void set_is_tagged(const bool val);
|
|
|
|
|
|
|
|
GSAISteeringAgent();
|
|
|
|
~GSAISteeringAgent();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
// Adds velocity, speed, and size data to `GSAIAgentLocation`.
|
|
|
|
//
|
|
|
|
// It is the character's responsibility to keep this information up to date for
|
|
|
|
// the steering toolkit to work correctly.
|
|
|
|
// @category - Base types
|
|
|
|
// The amount of velocity to be considered effectively not moving.
|
2023-01-13 23:01:38 +01:00
|
|
|
float zero_linear_speed_threshold;
|
2023-01-13 21:35:07 +01:00
|
|
|
// The maximum speed at which the agent can move.
|
2023-01-13 23:01:38 +01:00
|
|
|
float linear_speed_max;
|
2023-01-13 21:35:07 +01:00
|
|
|
// The maximum amount of acceleration that any behavior can apply to the agent.
|
2023-01-13 23:01:38 +01:00
|
|
|
float linear_acceleration_max;
|
2023-01-13 21:35:07 +01:00
|
|
|
// The maximum amount of angular speed at which the agent can rotate.
|
2023-01-13 23:01:38 +01:00
|
|
|
float angular_speed_max;
|
2023-01-13 21:35:07 +01:00
|
|
|
// The maximum amount of angular acceleration that any behavior can apply to an
|
|
|
|
// agent.
|
2023-01-13 23:01:38 +01:00
|
|
|
float angular_acceleration_max;
|
2023-01-13 21:35:07 +01:00
|
|
|
// Current velocity of the agent.
|
2023-01-13 23:01:38 +01:00
|
|
|
Vector3 linear_velocity;
|
2023-01-13 21:35:07 +01:00
|
|
|
// Current angular velocity of the agent.
|
2023-01-13 23:01:38 +01:00
|
|
|
float angular_velocity;
|
2023-01-13 21:35:07 +01:00
|
|
|
// The radius of the sphere that approximates the agent's size in space.
|
2023-01-13 23:01:38 +01:00
|
|
|
float bounding_radius;
|
2023-01-13 21:35:07 +01:00
|
|
|
// Used internally by group behaviors and proximities to mark the agent as already
|
|
|
|
// considered.
|
2023-01-13 23:01:38 +01:00
|
|
|
bool is_tagged;
|
2023-01-13 21:13:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|