本文整理汇总了C++中LPD3DXANIMATIONCONTROLLER::GetTrackDesc方法的典型用法代码示例。如果您正苦于以下问题:C++ LPD3DXANIMATIONCONTROLLER::GetTrackDesc方法的具体用法?C++ LPD3DXANIMATIONCONTROLLER::GetTrackDesc怎么用?C++ LPD3DXANIMATIONCONTROLLER::GetTrackDesc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPD3DXANIMATIONCONTROLLER
的用法示例。
在下文中一共展示了LPD3DXANIMATIONCONTROLLER::GetTrackDesc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SmoothLoiter
//-----------------------------------------------------------------------------
// Name: CTiny::SmoothLoiter()
// Desc: If Tiny is loitering, check if we have reached the end of animation.
// If so, set up a new track to play Loiter animation from the start and
// smoothly transition to the track, so that Tiny can loiter more.
//-----------------------------------------------------------------------------
void CTiny::SmoothLoiter()
{
LPD3DXANIMATIONCONTROLLER pAC;
LPD3DXANIMATIONSET pASTrack, pASLoiter;
m_pAI->GetAnimController( &pAC );
// check if we're loitering
pAC->GetTrackAnimationSet( m_dwCurrentTrack, &pASTrack );
pAC->GetAnimationSet( m_dwAnimIdxLoiter, &pASLoiter );
if( pASTrack && pASTrack == pASLoiter )
{
D3DXTRACK_DESC td;
pAC->GetTrackDesc( m_dwCurrentTrack, &td );
if( td.Position > pASTrack->GetPeriod() - IDLE_TRANSITION_TIME ) // come within the change delta of the end
SetIdleKey( true );
}
SAFE_RELEASE( pASTrack );
SAFE_RELEASE( pASLoiter );
SAFE_RELEASE( pAC );
}
示例2: Report
//-----------------------------------------------------------------------------
// Name: CTiny::Report()
// Desc: Add to the vector of strings, v_sReport, with useful information
// about this instance of CTiny.
//-----------------------------------------------------------------------------
void CTiny::Report( vector <String>& v_sReport )
{
WCHAR s[ 256 ];
try
{
swprintf_s( s, 256, L"Pos: %f, %f", m_vPos.x, m_vPos.z );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L"Facing: %f", m_fFacing );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L"Local time: %f", m_dTimeCurrent );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L"Pos Target: %f, %f", m_vPosTarget.x, m_vPosTarget.z );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L"Facing Target: %f", m_fFacingTarget );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L"Status: %s", m_bIdle ? L"Idle" : ( m_bWaiting ? L"Waiting" : L"Moving" ) );
v_sReport.push_back( String( s ) );
// report track data
LPD3DXANIMATIONCONTROLLER pAC;
LPD3DXANIMATIONSET pAS;
D3DXTRACK_DESC td;
m_pAI->GetAnimController( &pAC );
pAC->GetTrackAnimationSet( 0, &pAS );
WCHAR wstr[256];
MultiByteToWideChar( CP_ACP, 0, pAS->GetName(), -1, wstr, 256 );
swprintf_s( s, 256, L"Track 0: %s%s", wstr, m_dwCurrentTrack == 0 ? L" (current)" : L"" );
v_sReport.push_back( String( s ) );
pAS->Release();
pAC->GetTrackDesc( 0, &td );
swprintf_s( s, 256, L" Weight: %f", td.Weight );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L" Speed: %f", td.Speed );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L" Position: %f", td.Position );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L" Enable: %s", td.Enable ? L"true" : L"false" );
v_sReport.push_back( String( s ) );
pAC->GetTrackAnimationSet( 1, &pAS );
if( pAS )
{
MultiByteToWideChar( CP_ACP, 0, pAS->GetName(), -1, wstr, 256 );
pAS->Release();
}
else
{
swprintf_s( wstr, 256, L"n/a" );
}
swprintf_s( s, 256, L"Track 1: %s%s", wstr, m_dwCurrentTrack == 1 ? L" (current)" : L"" );
v_sReport.push_back( String( s ) );
pAC->GetTrackDesc( 1, &td );
swprintf_s( s, 256, L" Weight: %f", td.Weight );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L" Speed: %f", td.Speed );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L" Position: %f", td.Position );
v_sReport.push_back( String( s ) );
swprintf_s( s, 256, L" Enable: %s", td.Enable ? L"true" : L"false" );
v_sReport.push_back( String( s ) );
if( m_bUserControl )
{
swprintf_s( s, 256, L"Control: USER" );
v_sReport.push_back( String( s ) );
}
else
{
swprintf_s( s, 256, L"Control: AUTO" );
v_sReport.push_back( String( s ) );
}
pAC->Release();
}
catch( ... )
{
}
}