Fix angular velocity clamped to accel

This commit is contained in:
Francois Belair 2021-06-14 20:26:31 -04:00
parent 5b5ca11b03
commit 53cad0f660
3 changed files with 5 additions and 4 deletions

View File

@ -6,6 +6,7 @@ This document lists new features, improvements, changes, and bug fixes in every
- Removed the demos repository and brought demos back into main repo
- Added a repository with just the files for [submodule](https://github.com/GDQuest/godot-steering-ai-framework-submodule) usage.
- Fix a bug in GSAIKinematicBody2DAgent and GSAIKinematicBody3DAgent where angular velocity was clamped using max acceleration instead of max speed.
## Godot Steering AI Framework 3.0.0

View File

@ -92,8 +92,8 @@ func _apply_orientation_steering(angular_acceleration: float, delta: float) -> v
var velocity = clamp(
angular_velocity + angular_acceleration * delta,
-angular_acceleration_max,
angular_acceleration_max
-angular_speed_max,
angular_speed_max
)
if apply_angular_drag:
velocity = lerp(velocity, 0, angular_drag_percentage)

View File

@ -106,8 +106,8 @@ func _apply_orientation_steering(angular_acceleration: float, delta: float) -> v
var velocity = clamp(
angular_velocity + angular_acceleration * delta,
-angular_acceleration_max,
angular_acceleration_max
-angular_speed_max,
angular_speed_max
)
if apply_angular_drag:
velocity = lerp(velocity, 0, angular_drag_percentage)