本文整理汇总了C++中Orientation::GetYRot方法的典型用法代码示例。如果您正苦于以下问题:C++ Orientation::GetYRot方法的具体用法?C++ Orientation::GetYRot怎么用?C++ Orientation::GetYRot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orientation
的用法示例。
在下文中一共展示了Orientation::GetYRot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetActive
void EngineStatePoolShowShot::SetActive(bool active)
{
if (active)
{
GetEngine()->SetLetterbox(true);
m_pLevel = LevelServer::Instance()->GetCurrentLevel();
// The "take shot" animation expects the ball to be at the (x, z) origin.
Orientation o = *(GetActivePlayer()->GetOrientation());
Vec3f v = GetBall()->GetOrientation()->GetVertex();
o.SetX(v.x);
o.SetZ(v.z);
GetActivePlayer()->SetOrientation(o);
if (IsOnlineGame() &&
Engine::Instance()->GetGameState()->GetCurrentPlayerInfo()->m_isOnline) // TEST
{
// Player character was hidden, so unhide
GetActivePlayer()->SetAlpha(1.0f);
}
GetActivePlayer()->SetActionGo();
Assert(GetCamera().GetPtr());
// For testing, allow user to cycle through all valid shots.
// Don't play on until key is pressed.
#ifdef SHOW_VALID_SHOTS
SetMaxTime(99999.9f);
// Debug print info on current shot
m_validShotNum = -1;
Blue(true);
#else
// POOL - immediately play shot, as the use has already swing the cue.
// But do wait if player is not user controlled, so we see the swing
// animation.
if (IsUserControlled())
{
SetMaxTime(0);
}
else
{
SetMaxTime(GetEngine()->GetConfigFloat("golf_swing_time"));
// Pull the camera back so we can see where the AI player is aiming.
Camera* pCam = GetCamera().GetPtr();
PoolCamera* pPoolCam = dynamic_cast<PoolCamera*>(pCam);
if (pPoolCam)
{
pPoolCam->SetIsAiPlayer(true);
}
// If online player is taking shot we want the camera to be looking
// at the player character, not behind her.
if (IsOnlineGame())
{
#ifdef _DEBUG
std::cout << "*** IS ONLINE, setting camera...\n";
#endif
Orientation o = *(GetActivePlayer()->GetOrientation());
Orientation o2 = *(GetBall()->GetOrientation());
o2.SetYRot(o.GetYRot() + 180.0f); // look at from front
GetBall()->SetOrientation(o2);
GetCamera()->Reset();
}
}
#endif
m_time = 0;
}
else
{
GetEngine()->SetLetterbox(false);
}
}