6 protected override bool TestFunction(AIAgent agent, IEntity controlled)
11 Physics phy = controlled.GetPhysics();
17 vector velocityWorld = phy.GetVelocity();
18 float velocityAbsSq = velocityWorld.LengthSq();
19 if (velocityAbsSq <= 0.001)
22 vector velocityDir = velocityWorld.Normalized();
24 IEntity myEntity = agent.GetControlledEntity();
28 vector vecToMe = vector.Direction(controlled.GetOrigin(), myEntity.GetOrigin());
31 float cosAngle = vector.Dot(vecToMe, velocityDir);