diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-07 15:43:00 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-07 15:43:00 +0100 |
commit | fe8f985d2c7ea672a5f886d7d0df064f26bd2cb4 (patch) | |
tree | c09952570ac3732dfd821ae00fe379330e513e7c /src/crepe/system/AISystem.cpp | |
parent | 478f5f6232c46e1a60c023bf5dcbe2a934f42d84 (diff) |
improved physics for AI
Diffstat (limited to 'src/crepe/system/AISystem.cpp')
-rw-r--r-- | src/crepe/system/AISystem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crepe/system/AISystem.cpp b/src/crepe/system/AISystem.cpp index 55dc14c..324ee5f 100644 --- a/src/crepe/system/AISystem.cpp +++ b/src/crepe/system/AISystem.cpp @@ -130,7 +130,7 @@ vec2 AISystem::arrive(const AI & ai) { float distance = to_target.length(); if (distance > 0.0f) { float speed = distance / ai.arrive_deceleration; - speed = std::min(speed, rigidbody.data.max_linear_velocity.length()); + speed = std::min(speed, rigidbody.data.max_linear_velocity); vec2 desired_velocity = to_target * (speed / distance); return desired_velocity - rigidbody.data.linear_velocity; |