2019-12-16 17:22:03 +01:00
|
|
|
extends Pursue
|
|
|
|
class_name Evade
|
2019-12-17 05:12:18 +01:00
|
|
|
"""
|
|
|
|
Calculates acceleration to take an agent away from where a target agent will be.
|
|
|
|
|
|
|
|
The `max_predict_time` variable represents how far ahead to calculate the intersection point.
|
|
|
|
"""
|
2019-12-16 17:22:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
func _init(agent: SteeringAgent, target: SteeringAgent, max_predict_time: = 1.0).(agent, target, max_predict_time):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
func get_max_linear_acceleration() -> float:
|
|
|
|
return -agent.max_linear_acceleration
|