public static SteeringOutput GetSteering(KinematicState ownKS, SEvade info) { if (info.m_targetLinearVelocity == null) { return(NULL_STEERING); } float l_distanceToMe = (ownKS.m_position - info.m_target.position).magnitude; float l_predictedCollisionTime = l_distanceToMe / info.m_targetLinearVelocity.magnitude; l_predictedCollisionTime = MathExtent.Clip(l_predictedCollisionTime, info.m_maxPredictionTime); SURROGATE_TARGET.position = info.m_target.position + info.m_targetLinearVelocity * l_predictedCollisionTime; return(Flee.GetSteering(ownKS, SURROGATE_TARGET)); }
public void SetInfo(SEvade info) { m_info = info; }