BoundingSphere structure (directxcollision.h)

A bounding sphere object.

Syntax

struct BoundingSphere {
  XMFLOAT3                          Center;
  float                             Radius;
  void                              BoundingSphere() noexcept;
  void                              BoundingSphere(
    const BoundingSphere & unnamedParam1
  );
  BoundingSphere &                  operator=(
    const BoundingSphere & unnamedParam1
  );
  void                              BoundingSphere(
    BoundingSphere && unnamedParam1
  );
  BoundingSphere &                  operator=(
    BoundingSphere && unnamedParam1
  );
  void                              BoundingSphere(
    const XMFLOAT3 & center,
    float            radius
  ) noexcept;
  void XM_CALLCONV                  Transform(
    BoundingSphere & Out,
    FXMMATRIX        M
  ) noexcept;
  void XM_CALLCONV                  Transform(
    BoundingSphere & Out,
    float            Scale,
    FXMVECTOR        Rotation,
    FXMVECTOR        Translation
  ) noexcept;
  ContainmentType XM_CALLCONV       Contains(
    FXMVECTOR Point
  ) noexcept;
  ContainmentType XM_CALLCONV       Contains(
    FXMVECTOR V0,
    FXMVECTOR V1,
    FXMVECTOR V2
  ) noexcept;
  ContainmentType                   Contains(
    const BoundingSphere & sh
  ) noexcept;
  ContainmentType                   Contains(
    const BoundingBox & box
  ) noexcept;
  ContainmentType                   Contains(
    const BoundingOrientedBox & box
  ) noexcept;
  ContainmentType                   Contains(
    const BoundingFrustum & fr
  ) noexcept;
  bool                              Intersects(
    const BoundingSphere & sh
  ) noexcept;
  bool                              Intersects(
    const BoundingBox & box
  ) noexcept;
  bool                              Intersects(
    const BoundingOrientedBox & box
  ) noexcept;
  bool                              Intersects(
    const BoundingFrustum & fr
  ) noexcept;
  bool XM_CALLCONV                  Intersects(
    FXMVECTOR V0,
    FXMVECTOR V1,
    FXMVECTOR V2
  ) noexcept;
  PlaneIntersectionType XM_CALLCONV Intersects(
    FXMVECTOR Plane
  ) noexcept;
  bool XM_CALLCONV                  Intersects(
    FXMVECTOR Origin,
    FXMVECTOR Direction,
    float &   Dist
  ) noexcept;
  ContainmentType XM_CALLCONV       ContainedBy(
    FXMVECTOR Plane0,
    FXMVECTOR Plane1,
    FXMVECTOR Plane2,
    GXMVECTOR Plane3,
    HXMVECTOR Plane4,
    HXMVECTOR Plane5
  ) noexcept;
  void                              CreateMerged(
    BoundingSphere &       Out,
    const BoundingSphere & S1,
    const BoundingSphere & S2
  ) noexcept;
  void                              CreateFromBoundingBox(
    BoundingSphere &    Out,
    const BoundingBox & box
  ) noexcept;
  void                              CreateFromBoundingBox(
    BoundingSphere &            Out,
    const BoundingOrientedBox & box
  ) noexcept;
  void                              CreateFromPoints(
    BoundingSphere & Out,
    size_t           Count,
    const XMFLOAT3   *pPoints,
    size_t           Stride
  ) noexcept;
  void                              CreateFromFrustum(
    BoundingSphere &        Out,
    const BoundingFrustum & fr
  ) noexcept;
};

Members

Center

The center of the BoundingSphere.

Radius

The radius of the BoundingSphere.

void BoundingSphere() noexcept

Creates an instance of the BoundingSphere class.

void BoundingSphere( const BoundingSphere & unnamedParam1)

Creates an instance of the BoundingSphere class.

BoundingSphere & operator=( const BoundingSphere & unnamedParam1)

Initializes the BoundingSphere with values from a specified BoundingSphere.

void BoundingSphere( BoundingSphere && unnamedParam1)

BoundingSphere & operator=( BoundingSphere && unnamedParam1)

Initializes the BoundingSphere with values from a specified BoundingSphere.

void BoundingSphere( const XMFLOAT3 & center, float radius) noexcept

Creates an instance of the BoundingSphere class.

void XM_CALLCONV Transform( BoundingSphere & Out, FXMMATRIX M) noexcept

Transforms the BoundingSphere.

void XM_CALLCONV Transform( BoundingSphere & Out, float Scale, FXMVECTOR Rotation, FXMVECTOR Translation) noexcept

Transforms the BoundingSphere using the specified scale, rotation and translation vectors.

ContainmentType XM_CALLCONV Contains( FXMVECTOR Point) noexcept

Tests whether the BoundingSphere contains a specified point.

ContainmentType XM_CALLCONV Contains( FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) noexcept

Tests whether the BoundingSphere contains a specified triangle.

ContainmentType Contains( const BoundingSphere & sh) noexcept

Tests whether the BoundingSphere contains a specified BoundingSphere.

ContainmentType Contains( const BoundingBox & box) noexcept

Tests whether the BoundingSphere contains a specified BoundingBox.

ContainmentType Contains( const BoundingOrientedBox & box) noexcept

Tests whether the BoundingSphere contains the specified BoundingOrientedBox.

ContainmentType Contains( const BoundingFrustum & fr) noexcept

Tests whether the BoundingSphere contains the specified BoundingFrustum.

bool Intersects( const BoundingSphere & sh) noexcept

Tests the BoundingSphere for intersection with a BoundingSphere.

bool Intersects( const BoundingBox & box) noexcept

Tests the BoundingSphere for intersection with a BoundingBox.

bool Intersects( const BoundingOrientedBox & box) noexcept

Test the BoundingSphere for intersection with a BoundingOrientedBox.

bool Intersects( const BoundingFrustum & fr) noexcept

Test the BoundingSphere for intersection with a BoundingFrustum.

bool XM_CALLCONV Intersects( FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR V2) noexcept

Tests the BoundingSphere for intersection with a triangle.

PlaneIntersectionType XM_CALLCONV Intersects( FXMVECTOR Plane) noexcept

Tests the BoundingSphere for intersection with a Plane.

bool XM_CALLCONV Intersects( FXMVECTOR Origin, FXMVECTOR Direction, float & Dist) noexcept

Tests the BoundingSphere for intersection with a ray.

ContainmentType XM_CALLCONV ContainedBy( FXMVECTOR Plane0, FXMVECTOR Plane1, FXMVECTOR Plane2, GXMVECTOR Plane3, HXMVECTOR Plane4, HXMVECTOR Plane5) noexcept

Tests whether the BoundingSphere is contained by the specified frustum.

void CreateMerged( BoundingSphere & Out, const BoundingSphere & S1, const BoundingSphere & S2) noexcept

Creates a BoundingSphere that contains the two specified BoundingSphere objects.

void CreateFromBoundingBox( BoundingSphere & Out, const BoundingBox & box) noexcept

Creates a BoundingSphere containing the specified BoundingBox.

void CreateFromBoundingBox( BoundingSphere & Out, const BoundingOrientedBox & box) noexcept

Creates a BoundingSphere containing the specified BoundingBox.

void CreateFromPoints( BoundingSphere & Out, size_t Count, const XMFLOAT3 *pPoints, size_t Stride) noexcept

Creates a new BoundingSphere from a list of points.

void CreateFromFrustum( BoundingSphere & Out, const BoundingFrustum & fr) noexcept

Remarks

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.

Requirements

   
Header directxcollision.h

See also

DirectXMath Library Classes