Open implicit-invocation opened 8 years ago
Hmmm... Shouldn't something like
toTarget.set(target.getPosition()).sub(owner.getPosition());
be affected too?
and getDistance(agent:Steerable):float
, getDistanceSq(agent:Steerable):float
or getToTargetVector(agent:Steerable, agent:Steerable):Vector2
, maybe
At a first glance I'd say that toTarget
should be an instance of a class that extends Vector2 and overrides the appropriate methods.
But currently there's no way to set vectors internally used by behaviors.
Imagine our characters is moving on the surface of a sphere. So there will be 2 ways to calculate distance between them. But all of gdx-ai behaviors use owner.getPosition() to calculate distance.
I think Steerable interface should have
getDistance(point:Vector2):float
getDistanceSq(point:Vector2):float
method and behaviors will use them to decide how to seek, evade, flee...