D3DXConcatenateMeshes function

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.

Syntax

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

Parameters

ppMeshes [in]

Type: LPD3DXMESH*

Array of input mesh pointers (see ID3DXMesh). The number of elements in the array is NumMeshes.

NumMeshes [in]

Type: UINT

Number of input meshes to concatenate.

Options [in]

Type: DWORD

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]

Type: const D3DXMATRIX*

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]

Type: const D3DXMATRIX*

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]

Type: const D3DVERTEXELEMENT9*

Optional pointer to a vertex declaration (see D3DVERTEXELEMENT9). This parameter may be NULL.

pD3DDevice [in]

Type: LPDIRECT3DDEVICE9

Pointer to a IDirect3DDevice9 device that is used to create the new mesh.

ppMeshOut [out]

Type: LPD3DXMESH*

Address of a pointer to the mesh created (see ID3DXMesh).

Return value

Type: HRESULT

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 Optimize with Flags set to D3DXMESHOPT_COMPACT and D3DXMESHOPT_ATTRSORT (see D3DXMESHOPT).

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

Mesh Functions