From 967918fbe0540a1d1f86439b2fa58552df374de2 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 14 Jan 2023 03:14:27 +0100 Subject: [PATCH] Added Behaviors to the build. --- modules/steering_ai/SCsub | 15 +++++++++ .../behaviors/gsai_avoid_collisions.cpp | 4 +-- modules/steering_ai/config.py | 15 +++++++++ modules/steering_ai/register_types.cpp | 32 ++++++++++++++++++- 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/modules/steering_ai/SCsub b/modules/steering_ai/SCsub index adfacc610..aeed6ae26 100644 --- a/modules/steering_ai/SCsub +++ b/modules/steering_ai/SCsub @@ -19,6 +19,21 @@ sources = [ "proximities/gsai_radius_proximity.cpp", "proximities/gsai_infinite_proximity.cpp", + + "behaviors/gsai_arrive.cpp", + "behaviors/gsai_avoid_collisions.cpp", + "behaviors/gsai_blend.cpp", + "behaviors/gsai_cohesion.cpp", + "behaviors/gsai_evade.cpp", + "behaviors/gsai_face.cpp", + "behaviors/gsai_flee.cpp", + "behaviors/gsai_follow_path.cpp", + "behaviors/gsai_look_where_you_go.cpp", + "behaviors/gsai_match_orientation.cpp", + "behaviors/gsai_priority.cpp", + "behaviors/gsai_pursue.cpp", + "behaviors/gsai_seek.cpp", + "behaviors/gsai_separation.cpp", ] diff --git a/modules/steering_ai/behaviors/gsai_avoid_collisions.cpp b/modules/steering_ai/behaviors/gsai_avoid_collisions.cpp index 37f3f66e1..7001d1ed2 100644 --- a/modules/steering_ai/behaviors/gsai_avoid_collisions.cpp +++ b/modules/steering_ai/behaviors/gsai_avoid_collisions.cpp @@ -44,9 +44,7 @@ bool GSAIAvoidCollisions::_report_neighbor(Ref neighbor) { if (relative_speed_squared == 0) { return false; - } - - else { + } else { float time_to_collision = -relative_position.dot(relative_velocity) / relative_speed_squared; if (time_to_collision <= 0 || time_to_collision >= _shortest_time) { diff --git a/modules/steering_ai/config.py b/modules/steering_ai/config.py index 6fb7c43ee..6481b0b0b 100644 --- a/modules/steering_ai/config.py +++ b/modules/steering_ai/config.py @@ -18,6 +18,21 @@ def get_doc_classes(): "GSAIRadiusProximity", "GSAIInfiniteProximity", + + "GSAIArrive", + "GSAIAvoidCollisions", + "GSAIBlend", + "GSAICohesion", + "GSAIEvade", + "GSAIFace", + "GSAIFlee", + "GSAIFollowPath", + "GSAILookWhereYouGo", + "GSAIMatchOrientation", + "GSAIPriority", + "GSAIPursue", + "GSAISeek", + "GSAISeparation", ] def get_doc_path(): diff --git a/modules/steering_ai/register_types.cpp b/modules/steering_ai/register_types.cpp index 97906772e..b0d2e36a4 100644 --- a/modules/steering_ai/register_types.cpp +++ b/modules/steering_ai/register_types.cpp @@ -35,8 +35,23 @@ SOFTWARE. #include "gsai_target_acceleration.h" #include "proximities/gsai_proximity.h" -#include "proximities/gsai_radius_proximity.h" #include "proximities/gsai_infinite_proximity.h" +#include "proximities/gsai_radius_proximity.h" + +#include "behaviors/gsai_arrive.cpp" +#include "behaviors/gsai_avoid_collisions.cpp" +#include "behaviors/gsai_blend.cpp" +#include "behaviors/gsai_cohesion.cpp" +#include "behaviors/gsai_evade.cpp" +#include "behaviors/gsai_face.cpp" +#include "behaviors/gsai_flee.cpp" +#include "behaviors/gsai_follow_path.cpp" +#include "behaviors/gsai_look_where_you_go.cpp" +#include "behaviors/gsai_match_orientation.cpp" +#include "behaviors/gsai_priority.cpp" +#include "behaviors/gsai_pursue.cpp" +#include "behaviors/gsai_seek.cpp" +#include "behaviors/gsai_separation.cpp" static GSAIUtils *gs_ai_utils = NULL; @@ -55,6 +70,21 @@ void register_steering_ai_types() { ClassDB::register_class(); ClassDB::register_class(); + + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); + ClassDB::register_class(); } void unregister_steering_ai_types() {