D3DXComputeBoundingSphere

Computes a bounding sphere for the mesh.

HRESULT D3DXComputeBoundingSphere(
  CONST D3DXVECTOR3 * pFirstPosition,
  DWORD NumVertices,
  DWORD dwStride,
  D3DXVECTOR3 * pCenter,
  FLOAT * pRadius
);

Parameters

pFirstPosition
[in] Pointer to first position.
NumVertices
[in] Number of vertices.
dwStride
[in] Number of bytes between position vectors. Use ID3DXBaseMesh::GetNumBytesPerVertex, D3DXGetFVFVertexSize, or D3DXGetDeclVertexSize to get the vertex stride.
pCenter
[out] D3DXVECTOR3 structure, defining the coordinate center of the returned bounding sphere.
pRadius
[out] Radius of the returned bounding sphere.

Return Values

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

Header: Declared in D3dx9mesh.h.