void SkinnedMesh::DrawFrame() { LPD3DXMESHCONTAINER pMeshContainer; // 조심해! // 적당한 위치 찾을 것 DDRenderer::GetInstance()->GetDevice()->SetTransform( D3DTS_WORLD, &m_Matrix ); pMeshContainer = m_pFrameRoot->pMeshContainer; while ( pMeshContainer != NULL ) { DrawMeshContainer( pMeshContainer, m_pFrameRoot ); pMeshContainer = pMeshContainer->pNextMeshContainer; } if ( m_pFrameRoot->pFrameSibling != NULL ) { DrawFrame( m_pFrameRoot->pFrameSibling ); } if ( m_pFrameRoot->pFrameFirstChild != NULL ) { DrawFrame( m_pFrameRoot->pFrameFirstChild ); } }
HRESULT CAnimationModel::DrawFrame( LPD3DXFRAME pFrame ) { HRESULT hr = S_OK; LPD3DXMESHCONTAINER pMeshContainer = pFrame->pMeshContainer; while( NULL != pMeshContainer ) { hr = DrawMeshContainer( pFrame, pMeshContainer ); CHECK_FAILED( hr ); pMeshContainer = pMeshContainer->pNextMeshContainer; } if( pFrame->pFrameSibling ) { hr = DrawFrame( pFrame->pFrameSibling ); CHECK_FAILED( hr ); } if( pFrame->pFrameFirstChild ) { hr = DrawFrame( pFrame->pFrameFirstChild ); CHECK_FAILED( hr ); } return hr; }
void SkinnedMesh::DrawFrame( LPD3DXFRAME pFrame ) { DDCamera* camera = GPlayerManager->GetCamera(); if ( !camera ) return; D3DXMATRIXA16 matProj = camera->GetMatProj(); // Set the projection matrix for the vertex shader based skinning method if ( FAILED( m_pEffect->SetMatrix( "mViewProj", &matProj ) ) ) { assert( false ); return; } // Set Light for vertex shader // 조심해!! // 전역 라이트 속성 가져올 것 D3DXVECTOR4 vLightDir( 0.0f, 1.0f, -1.0f, 0.0f ); D3DXVec4Normalize( &vLightDir, &vLightDir ); if ( FAILED( DDRenderer::GetInstance()->GetDevice()->SetVertexShaderConstantF( 1, (float*)&vLightDir, 1 ) ) ) { assert( false ); return; } if ( FAILED( m_pEffect->SetVector( "lhtDir", &vLightDir ) ) ) { assert( false ); return; } LPD3DXMESHCONTAINER pMeshContainer; pMeshContainer = pFrame->pMeshContainer; while ( pMeshContainer != NULL ) { DrawMeshContainer( pMeshContainer, pFrame ); pMeshContainer = pMeshContainer->pNextMeshContainer; } if ( pFrame->pFrameSibling != NULL ) { DrawFrame( pFrame->pFrameSibling ); } if ( pFrame->pFrameFirstChild != NULL ) { DrawFrame( pFrame->pFrameFirstChild ); } }
/** * \brief Called to render a frame in the hierarchy * \param device - the Direct3D device object * \param frame - frame to render * \author Keith Ditchburn \date 18 July 2005 */ void CXFileEntity::DrawFrame(LPD3DXFRAME frame) { // Draw all mesh containers in this frame LPD3DXMESHCONTAINER meshContainer = frame->pMeshContainer; while (meshContainer) { DrawMeshContainer(meshContainer, frame); meshContainer = meshContainer->pNextMeshContainer; } // Recurse for sibblings if (frame->pFrameSibling != NULL) DrawFrame(frame->pFrameSibling); // Recurse for children if (frame->pFrameFirstChild != NULL) DrawFrame(frame->pFrameFirstChild); }
//-------------------------------------------------------------------------------------- // Called to render a frame in the hierarchy //-------------------------------------------------------------------------------------- void DrawFrame( IDirect3DDevice9* pd3dDevice, LPD3DXFRAME pFrame ) { LPD3DXMESHCONTAINER pMeshContainer; pMeshContainer = pFrame->pMeshContainer; while( pMeshContainer != NULL ) { DrawMeshContainer( pd3dDevice, pMeshContainer, pFrame ); pMeshContainer = pMeshContainer->pNextMeshContainer; } if( pFrame->pFrameSibling != NULL ) { DrawFrame( pd3dDevice, pFrame->pFrameSibling ); } if( pFrame->pFrameFirstChild != NULL ) { DrawFrame( pd3dDevice, pFrame->pFrameFirstChild ); } }
void XEnitity::DrawFrame(LPD3DXFRAME pFrame) const { LPD3DXMESHCONTAINER pMeshContainer = pFrame->pMeshContainer; while(pMeshContainer != NULL){ DrawMeshContainer(pMeshContainer, pFrame); pMeshContainer = pMeshContainer->pNextMeshContainer; } //pass to sibling if(pFrame->pFrameSibling){ DrawFrame(pFrame->pFrameSibling); } //pass to child if(pFrame->pFrameFirstChild){ DrawFrame(pFrame->pFrameFirstChild); } return; }
void CLcXSkinSrc::DrawFrame(SFrame* pFrame) { SMeshContainer* pMeshContainer; pMeshContainer = pFrame->pmcMesh; while (pMeshContainer != NULL) { DrawMeshContainer(pMeshContainer, pFrame); pMeshContainer = pMeshContainer->pNextMeshContainer; } if (pFrame->pFrameSibling != NULL) { DrawFrame(pFrame->pFrameSibling); } if (pFrame->pFrameFirstChild != NULL) { DrawFrame(pFrame->pFrameFirstChild); } }
void MoonSkinmesh::DrawFrame(LPD3DXFRAME pFrame) { LPD3DXMESHCONTAINER pMeshContainer; pMeshContainer = pFrame->pMeshContainer; while (pMeshContainer != NULL) { DrawMeshContainer(pMeshContainer, pFrame); pMeshContainer = pMeshContainer->pNextMeshContainer; } if (pFrame->pFrameSibling != NULL) { DrawFrame(pFrame->pFrameSibling); } if (pFrame->pFrameFirstChild != NULL) { DrawFrame(pFrame->pFrameFirstChild); } }
void CDexModelXAni::DrawFrame(LPD3DXFRAME pFrame) { LPD3DXMESHCONTAINER pMeshContainer; pMeshContainer = pFrame->pMeshContainer; //先绘出蒙皮 while (pMeshContainer != NULL) { DrawMeshContainer(pMeshContainer, pFrame); //调用子函数 pMeshContainer = pMeshContainer->pNextMeshContainer; } //后绘框架,采用递归调用 if (pFrame->pFrameSibling != NULL) { DrawFrame(pFrame->pFrameSibling); } if (pFrame->pFrameFirstChild != NULL) { DrawFrame(pFrame->pFrameFirstChild); } }