本文整理汇总了C++中CModel::GetModelType方法的典型用法代码示例。如果您正苦于以下问题:C++ CModel::GetModelType方法的具体用法?C++ CModel::GetModelType怎么用?C++ CModel::GetModelType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModel
的用法示例。
在下文中一共展示了CModel::GetModelType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
void CSfxParticle::Render( LPDIRECT3DDEVICE9 pd3dDevice )
{
CModel* pModel = m_pModel;
DWORD dwModelType = pModel->GetModelType();
//m_vScale = D3DXVECTOR3( 3.0f, 13.0f, 13.0f );
D3DXMATRIX matTrans;
D3DXMATRIX matScale;
D3DXMATRIX matRotation;
D3DXMatrixScaling( &matScale, m_vScale.x, m_vScale.y, m_vScale.z );
D3DXMatrixRotationY( &matRotation, D3DXToRadian( -m_fAngle ) );
D3DXMatrixTranslation( &matTrans, m_vPos.x, m_vPos.y, m_vPos.z);
static FLOAT m_fRadian = 0;
static FLOAT m_fScane = 0;
D3DXMATRIX matWorld ;
/*
D3DXVECTOR3 vDir = (g_WorldMng()->m_pCamera->m_vLookAt) - (g_WorldMng()->m_pCamera->m_vPos2);
D3DXVec3Normalize( &vDir, &vDir );
FLOAT y = ( vDir.x > 0.0f ) ? -atanf( vDir.z / vDir.x) + D3DX_PI / 2 : -atanf( vDir.z / vDir.x) - D3DX_PI / 2; // y
FLOAT x = -asinf( vDir.y);
D3DXMatrixRotationYawPitchRoll( &matRotation, y, x, m_fRadian );
*/
// D3DXMatrixRotationZ(&matRotation,D3DXToRadian(45.0f));
// D3DXMatrixRotationZ(&matRotation,0);
// matRotation*=g_WorldMng()->m_pCamera->m_matInvView;
matRotation=g_WorldMng()->m_pCamera->m_matInvView;
m_fRadian += 0.05f;
if( m_fRadian > D3DX_PI * 2 )
m_fRadian -= D3DX_PI * 2;
//D3DXVECTOR3 vScale( m_fScane, m_fScane, m_fScane );
/*
D3DXMatrixIdentity( &matWorld );
D3DXMatrixMultiply( &matWorld, &matWorld, &matScale );
D3DXMatrixMultiply( &matWorld, &matWorld, &matRotation );
D3DXMatrixMultiply( &matWorld, &matWorld, &(g_WorldMng()->m_pCamera->m_matInvView) );
D3DXMatrixMultiply( &matWorld, &matWorld, &matTrans );
*/
matWorld=matScale*matRotation*matTrans;
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
m_nEffect=0;
m_pModel->SetFrame( m_nEffect );
m_pModel->Render( pd3dDevice, NULL );
}