ID3DXSkinInfo::ConvertToBlendedMesh
Takes a mesh and returns a new mesh with per-vertex blend weights and a bone combination table. The table describes which bones affect which subsets of the mesh.
HRESULT ConvertToBlendedMesh(
LPD3DXMESH pMesh,
DWORD Options,
CONST DWORD * pAdjacencyIn,
LPDWORD pAdjacencyOut,
DWORD * pFaceRemap,
LPD3DXBUFFER * ppVertexRemap,
DWORD * pMaxVertexInfl,
DWORD * pNumBoneCombinations,
LPD3DXBUFFER * ppBoneCombinationTable,
LPD3DXMESH * ppMesh
);
Parameters
- pMesh
- [in] Input mesh. See ID3DXMesh.
- Options
- [in] Currently unused.
- pAdjacencyIn
- [in] Input mesh adjacency information.
- pAdjacencyOut
- [in] Output mesh adjacency information.
- pFaceRemap
- [out] An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the blended mesh. If the value supplied for this argument is NULL, face remap data is not returned.
- ppVertexRemap
- [out] Address of a pointer to an ID3DXBuffer interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping. This parameter is optional; NULL may be used.
- pMaxVertexInfl
- [out] Pointer to a DWORD that will contain the maximum number of bone influences required per vertex for this skinning method.
- pNumBoneCombinations
- [out] Pointer to the number of bones in the bone combination table.
- ppBoneCombinationTable
- [out] Pointer to the bone combination table. The data is organized in a D3DXBONECOMBINATION structure.
- ppMesh
- [out] Pointer to the new mesh.
Return Values
If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.
Remarks
Each element in the remap array specifies the previous index for that position. For example, if a vertex was in position 3 but has been remapped to position 5, then the fifth element of pVertexRemap will contain 3.
This method does not run on hardware that does not support fixed-function vertex blending.
Requirements
Header: Declared in D3dx9mesh.h.