D3DXConcatenateMeshes

Concatenates a group of meshes into one common mesh. This method can optionally apply a matrix transformation to each input mesh and its texture coordinates.

HRESULT D3DXConcatenateMeshes(
  LPD3DXMESH * ppMeshes,
  UINT NumMeshes,
  DWORD Options,
  CONST D3DXMATRIX * pGeomXForms,
  CONST D3DXMATRIX * pTextureXForms,
  CONST D3DVERTEXELEMENT9 * pDecl,
  LPDIRECT3DDEVICE9 pD3DDevice,
  LPD3DXMESH * ppMeshOut
);

Parameters

ppMeshes
[in] Array of input mesh pointers (see ID3DXMesh). The number of elements in the array is NumMeshes.
NumMeshes
[in] Number of input meshes to concatenate.
Options
[in] Mesh creation options; this is a combination of one or more D3DXMESH flags. The mesh creation options are equivalent to the options parameter required by D3DXCreateMesh.
pGeomXForms
[in] Optional array of geometry transforms. The number of elements in the array is NumMeshes; each element is a transformation matrix (see D3DXMATRIX). May be NULL.
pTextureXForms
[in] Optional array of texture transforms. The number of elements in the array is NumMeshes; each element is a transformation matrix (see D3DXMATRIX). This parameter may be NULL.
pDecl
[in] Optional pointer to a vertex declaration (see D3DVERTEXELEMENT9). This parameter may be NULL.
pD3DDevice
[in] Pointer to a IDirect3DDevice9 device that is used to create the new mesh.
ppMeshOut
[out] Address of a pointer to the mesh created (see ID3DXMesh).

Return Values

If the function succeeds, the return value is S_OK. If the function fails, the return value can be one of these: D3DERR_INVALIDCALL, E_OUTOFMEMORY.

Remarks

If no vertex declaration is given as part of the Options mesh creation parameter, the method will generate a union of all of the vertex declarations of the submeshes, promoting channels and types if necessary. The method will create an attribute table from attribute tables of the input meshes. To ensure creation of an attribute table, call ID3DXMesh::Optimize with Flags set to D3DXMESHOPT_COMPACT and D3DXMESHOPT_ATTRSORT (see D3DXMESHOPT).

Requirements

Header: Declared in D3dx9mesh.h.