mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2025-01-09 22:09:37 +01:00
parent
5627a5636a
commit
18931a9623
@ -32,9 +32,13 @@ func _calculate_steering(acceleration: GSTTargetAcceleration) -> void:
|
|||||||
|
|
||||||
var distance := path.calculate_distance(location)
|
var distance := path.calculate_distance(location)
|
||||||
var target_distance := distance + path_offset
|
var target_distance := distance + path_offset
|
||||||
|
|
||||||
|
if prediction_time > 0 and path.is_open:
|
||||||
|
if target_distance < path.calculate_distance(agent.position):
|
||||||
|
target_distance = path.length
|
||||||
|
|
||||||
var target_position := path.calculate_target_position(target_distance)
|
var target_position := path.calculate_target_position(target_distance)
|
||||||
|
|
||||||
if is_arrive_enabled and path.is_open:
|
if is_arrive_enabled and path.is_open:
|
||||||
if path_offset >= 0:
|
if path_offset >= 0:
|
||||||
if target_distance > path.length - deceleration_radius:
|
if target_distance > path.length - deceleration_radius:
|
||||||
|
Loading…
Reference in New Issue
Block a user