本文整理汇总了C++中PlayerState::GetPosConf方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerState::GetPosConf方法的具体用法?C++ PlayerState::GetPosConf怎么用?C++ PlayerState::GetPosConf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerState
的用法示例。
在下文中一共展示了PlayerState::GetPosConf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CorrectTurnForDash
/*
* This function is used to correct the target position when near the ball.
* @param player the player to consider.
* @param target the target position to go to.
* @param fix the distance error to fix.
* @return position corrected.
*/
Vector Dasher::CorrectTurnForDash(const PlayerState & player, const Vector & target, double fix)
{
if (player.GetPosConf() > 0.99 - FLOAT_EPS && player.GetBodyDirConf() > 0.99 - FLOAT_EPS) {
Ray body_ray(player.GetPos(), player.GetBodyDir());
Line body_line(body_ray);
Vector closest_pt = body_line.GetProjectPoint(target);
double buffer = 0.05 + ServerParam::instance().ballSize();
if (closest_pt.Dist(player.GetPos()) > player.GetKickableArea() + buffer - fix){
if (closest_pt.Dist(target)
< player.GetKickableArea() - buffer + fix){
return closest_pt;
}
}
}
return target;
}