D3DXComputeBoundingSphere function (D3DX9Mesh.h)

Note

The D3DX utility library is deprecated. We recommend that you use DirectXMath instead.

Computes a bounding sphere for the mesh.

Syntax

HRESULT D3DXComputeBoundingSphere(
  _In_  const D3DXVECTOR3 *pFirstPosition,
  _In_        DWORD       NumVertices,
  _In_        DWORD       dwStride,
  _Out_       D3DXVECTOR3 *pCenter,
  _Out_       FLOAT       *pRadius
);

Parameters

pFirstPosition [in]

Type: const D3DXVECTOR3*

Pointer to first position.

NumVertices [in]

Type: DWORD

Number of vertices.

dwStride [in]

Type: DWORD

Number of bytes between position vectors. Use GetNumBytesPerVertex, D3DXGetFVFVertexSize, or D3DXGetDeclVertexSize to get the vertex stride.

pCenter [out]

Type: D3DXVECTOR3*

D3DXVECTOR3 structure, defining the coordinate center of the returned bounding sphere.

pRadius [out]

Type: FLOAT*

Radius of the returned bounding sphere.

Return value

Type: HRESULT

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL.

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

Mesh Functions