|
|
bool ComputeBoundingBox(LPD3DXMESH mesh,SD3D::BoundingBox* box)
{
HRESULT hr = 0;
BYTE* v = 0;
mesh->LockVertexBuffer(0, (void**)&v);
hr = D3DXComputeBoundingBox(
(D3DXVECTOR3*)v,
mesh->GetNumVertices(),
D3DXGetFVFVertexSize(mesh->GetFVF()),
&box->_min,
&box->_max);
mesh->UnlockVertexBuffer();
if( FAILED(hr) )
return false;
return true;
}
SD3D::BoundingBox *B=0;
.......
ComputeBoundingBox(&m_pMesh,&B);
错误信息为: error C2664: “ComputeBoundingBox” : 不能将参数 2 从“SD3D::BoundingBox **__w64 ”转换为“SD3D::BoundingBox *” 与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
[em17] |
|