Steering Behavior and A*
Posted: Sun Aug 12, 2012 10:34 am
Hi all. I'm not sure if I'm posting this topic in the right place and please correct me if I'm wrong. I'm about to implement steering behaviors and would like to know how I could combine it with A* on a navigation mesh if it's necessary.
I have the pursuit function very simple:
core::vector3df Pursuit(Agent* evader)
{
double dist = evader->pos().getDistanceFrom(m_Agent->pos());
double time = dist / evader->GetSpeed();
core::vector3df targetPos = evader->GetPosition() + (evader->GetVelocity() * time);
return Seek(targetPos);
}
since a navigation mesh doesn't have any static obstacles (as far as I've noticed it contains just the walkable areas), is the above function enough for a an evader to pursue an agent or it still needs an obstacle avoidance steering behavior or, I should use A* in each update to find a path from evader's position to targetPos calculated from pursuit function?
I have the pursuit function very simple:
core::vector3df Pursuit(Agent* evader)
{
double dist = evader->pos().getDistanceFrom(m_Agent->pos());
double time = dist / evader->GetSpeed();
core::vector3df targetPos = evader->GetPosition() + (evader->GetVelocity() * time);
return Seek(targetPos);
}
since a navigation mesh doesn't have any static obstacles (as far as I've noticed it contains just the walkable areas), is the above function enough for a an evader to pursue an agent or it still needs an obstacle avoidance steering behavior or, I should use A* in each update to find a path from evader's position to targetPos calculated from pursuit function?