2019-12-19 20:04:08 +01:00
|
|
|
extends GSTPursue
|
|
|
|
class_name GSTEvade
|
2020-01-02 23:42:41 +01:00
|
|
|
# Calculates acceleration to take an agent away from where a target agent will be.
|
2019-12-17 05:12:18 +01:00
|
|
|
|
2020-01-02 23:42:41 +01:00
|
|
|
# # The `max_predict_time` variable represents how far ahead to calculate the intersection point.
|
2019-12-16 17:22:03 +01:00
|
|
|
|
|
|
|
|
2019-12-19 20:04:08 +01:00
|
|
|
func _init(
|
|
|
|
agent: GSTSteeringAgent,
|
|
|
|
target: GSTSteeringAgent,
|
2020-01-16 09:44:44 +01:00
|
|
|
max_predict_time := 1.0).(agent, target, max_predict_time):
|
2019-12-16 17:22:03 +01:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-12-19 20:04:08 +01:00
|
|
|
func _get_modified_acceleration() -> float:
|
2019-12-16 17:22:03 +01:00
|
|
|
return -agent.max_linear_acceleration
|