pandemonium_engine/modules/steering_ai/behaviors/gsai_flee.cpp

24 lines
541 B
C++
Raw Normal View History

2023-01-13 21:29:17 +01:00
#include "gsai_flee.h"
2023-01-14 02:31:42 +01:00
#include "../gsai_agent_location.h"
#include "../gsai_steering_agent.h"
#include "../gsai_target_acceleration.h"
2023-01-14 02:31:42 +01:00
void GSAIFlee::_calculate_steering(Ref<GSAITargetAcceleration> acceleration) {
ERR_FAIL_COND(!agent.is_valid());
ERR_FAIL_COND(!target.is_valid());
acceleration->set_linear((agent->get_position() - target->get_position()).normalized() * agent->get_linear_acceleration_max());
acceleration->set_angular(0);
}
GSAIFlee::GSAIFlee() {
}
GSAIFlee::~GSAIFlee() {
}
2023-01-14 02:31:42 +01:00
void GSAIFlee::_bind_methods() {
}