本文整理汇总了C++中Orientation::GetY方法的典型用法代码示例。如果您正苦于以下问题:C++ Orientation::GetY方法的具体用法?C++ Orientation::GetY怎么用?C++ Orientation::GetY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orientation
的用法示例。
在下文中一共展示了Orientation::GetY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void PoolCue::Draw()
{
#ifdef CUE_DEBUG
glLineWidth(2.0f);
glBegin(GL_LINES);
glVertex3f(m_v1.x, m_v1.y, m_v1.z);
glVertex3f(m_v2.x, m_v2.y, m_v2.z);
glEnd();
return;
#endif
// Position cue - take into account
// - ball pos
// - Y-rot of player; i.e. the shot angle
// - cue elevation; i.e. masse
// - cue contact pos
// Find ball centre.
Orientation o = *(GetBall()->GetOrientation());
// Move the centre depending on draw/roll/english
// Find player shot direction.
float yr = Engine::Instance()->GetGameState()->GetCurrentPlayerInfo()->m_golfStroke.m_yRot;
float elev = Engine::Instance()->GetGameState()->GetCurrentPlayerInfo()->m_golfStroke.m_cueElevationDegs;
#ifdef CUE_DEBUG
std::cout << "POOL CUE: Elev: " << elev << " degs\n";
#endif
// If in birds eye mode, move the cue up a bit so it doesn't intersect
// the table.
if (EngineStatePoolBase::IsBirdsEye())
{
o.SetY(o.GetY() + 2.0f);
}
AmjuGL::PushMatrix();
o.SetZRot(elev);
o.SetYRot(yr + 90.0f);
o.Draw();
// Set contact pos
AmjuGL::Translate(0, m_y, m_x);
// Swing cue forward or back
AmjuGL::Translate(m_swingPos, 0, 0);
m_pSolid->Draw();
AmjuGL::PopMatrix();
}