本文整理汇总了C++中CClientPlayer::GetRotationDegrees方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientPlayer::GetRotationDegrees方法的具体用法?C++ CClientPlayer::GetRotationDegrees怎么用?C++ CClientPlayer::GetRotationDegrees使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientPlayer
的用法示例。
在下文中一共展示了CClientPlayer::GetRotationDegrees方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoRender
void CRadarMap::DoRender ( void )
{
bool bIsRadarShowing = IsRadarShowing ();
// Render if showing
if ( bIsRadarShowing )
{
// Get the alpha value from the settings
int iRadarAlpha;
g_pCore->GetCVars()->Get ( "mapalpha", iRadarAlpha );
g_pCore->GetGraphics()->DrawTexture ( m_pRadarImage, static_cast < float > ( m_iMapMinX ),
static_cast < float > ( m_iMapMinY ),
m_fMapSize / m_pRadarImage->m_uiSizeX,
m_fMapSize / m_pRadarImage->m_uiSizeY,
0.0f, 0.0f, 0.0f,
SColorARGB ( iRadarAlpha, 255, 255, 255 ) );
// Grab the info for the local player blip
CVector2D vecLocalPos;
CVector vecLocal;
CVector vecLocalRot;
if ( m_pManager->GetCamera()->IsInFixedMode() )
{
m_pManager->GetCamera()->GetPosition ( vecLocal );
m_pManager->GetCamera()->GetRotation ( vecLocalRot );
}
else
{
CClientPlayer* pLocalPlayer = m_pManager->GetPlayerManager ()->GetLocalPlayer ();
if ( !pLocalPlayer )
return;
pLocalPlayer->GetPosition ( vecLocal );
pLocalPlayer->GetRotationDegrees ( vecLocalRot );
}
CalculateEntityOnScreenPosition ( vecLocal, vecLocalPos );
// Now loop our radar areas
unsigned short usDimension = m_pRadarAreaManager->GetDimension ();
CClientRadarArea * pArea = NULL;
list < CClientRadarArea* > ::const_iterator areaIter = m_pRadarAreaManager->IterBegin ();
for ( ; areaIter != m_pRadarAreaManager->IterEnd (); areaIter++ )
{
pArea = *areaIter;
if ( pArea->GetDimension() == usDimension )
{
// Grab the area image and calculate the position to put it on the screen
CVector2D vecPos;
CalculateEntityOnScreenPosition ( pArea, vecPos );
// Get the area size and work out the ratio
CVector2D vecSize;
float fX = (*areaIter)->GetSize ().fX;
float fY = (*areaIter)->GetSize ().fY;
float fRatio = 6000.0f / m_fMapSize;
// Calculate the size of the area
vecSize.fX = static_cast < float > ( fX / fRatio );
vecSize.fY = static_cast < float > ( fY / fRatio );
g_pCore->GetGraphics ()->DrawRectangle ( vecPos.fX, vecPos.fY, vecSize.fX, -vecSize.fY, pArea->GetColor () );
}
}
// Now loop our radar markers
usDimension = m_pRadarMarkerManager->GetDimension();
list < CClientRadarMarker* > ::const_iterator markerIter = m_pRadarMarkerManager->IterBegin ();
for ( ; markerIter != m_pRadarMarkerManager->IterEnd (); markerIter++ )
{
if ( (*markerIter)->IsVisible () && (*markerIter)->GetDimension() == usDimension )
{
// Grab the marker image and calculate the position to put it on the screen
float fScale = 1;
SColor color;
CTextureItem* pTexture = GetMarkerTexture ( *markerIter, vecLocal.fZ, &fScale, &color );
if ( pTexture )
{
CVector2D vecPos;
CalculateEntityOnScreenPosition ( *markerIter, vecPos );
g_pCore->GetGraphics()->DrawTexture ( pTexture, vecPos.fX, vecPos.fY, fScale, fScale, 0.0f, 0.5f, 0.5f, color );
}
}
}
g_pCore->GetGraphics()->DrawTexture ( m_pLocalPlayerBlip, vecLocalPos.fX, vecLocalPos.fY, 1.0, 1.0, vecLocalRot.fZ, 0.5f, 0.5f );
}
// Update visibility of help text
bool bRequiredTextVisible = bIsRadarShowing && !m_bHideHelpText;
if ( bRequiredTextVisible != m_bTextVisible )
{
m_bTextVisible = bRequiredTextVisible;
for ( uint i = 0 ; i < m_HelpTextList.size () ; i++ )
m_HelpTextList[i]->SetVisible ( m_bTextVisible );
SetupMapVariables ();
}
}