2023-01-13 22:04:30 +01:00
|
|
|
#ifndef GSAI_COHESION_H
|
|
|
|
#define GSAI_COHESION_H
|
2023-01-13 21:13:57 +01:00
|
|
|
|
|
|
|
class GSAICohesion : public GSAIGroupBehavior {
|
2023-01-13 21:35:07 +01:00
|
|
|
GDCLASS(GSAICohesion, GSAIGroupBehavior);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
public:
|
|
|
|
Vector3 get__center_of_mass();
|
|
|
|
void set__center_of_mass(const Vector3 &val);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
void _calculate_steering(const GSAITargetAcceleration &acceleration);
|
|
|
|
bool _report_neighbor(const GSAISteeringAgent &neighbor);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
GSAICohesion();
|
|
|
|
~GSAICohesion();
|
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
|
|
|
// Calculates an acceleration that attempts to move the agent towards the center
|
|
|
|
// of mass of the agents in the area defined by the `GSAIProximity`.
|
|
|
|
// @category - Group behaviors
|
|
|
|
Vector3 _center_of_mass = ;
|
2023-01-13 21:13:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|