BoundingBox structure (directxcollision.h)

A bounding axis-aligned object.

Syntax

struct BoundingBox {
  size_t                            CORNER_COUNT;
  XMFLOAT3                          Center;
  XMFLOAT3                          Extents;
  void                              BoundingBox() noexcept;
  void                              BoundingBox(
    const BoundingBox & unnamedParam1
  );
  BoundingBox &                     operator=(
    const BoundingBox & unnamedParam1
  );
  void                              BoundingBox(
    BoundingBox && unnamedParam1
  );
  BoundingBox &                     operator=(
    BoundingBox && unnamedParam1
  );
  void                              BoundingBox(
    const XMFLOAT3 & center,
    const XMFLOAT3 & extents
  ) noexcept;
  void XM_CALLCONV                  Transform(
    BoundingBox & Out,
    FXMMATRIX     M
  ) noexcept;
  void XM_CALLCONV                  Transform(
    BoundingBox & Out,
    float         Scale,
    FXMVECTOR     Rotation,
    FXMVECTOR     Translation
  ) noexcept;
  void                              GetCorners(
    XMFLOAT3 *Corners
  ) 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(
    BoundingBox &       Out,
    const BoundingBox & b1,
    const BoundingBox & b2
  ) noexcept;
  void                              CreateFromSphere(
    BoundingBox &          Out,
    const BoundingSphere & sh
  ) noexcept;
  void XM_CALLCONV                  CreateFromPoints(
    BoundingBox & Out,
    FXMVECTOR     pt1,
    FXMVECTOR     pt2
  ) noexcept;
  void                              CreateFromPoints(
    BoundingBox &  Out,
    size_t         Count,
    const XMFLOAT3 *pPoints,
    size_t         Stride
  ) noexcept;
};

Members

CORNER_COUNT

The number of points defining the BoundingBox.

Center

The center of the BoundingBox.

Extents

The extents of the BoundingBox.

void BoundingBox() noexcept

Creates an instance of the BoundingBox class.

void BoundingBox( const BoundingBox & unnamedParam1)

Creates an instance of the BoundingBox class.

BoundingBox & operator=( const BoundingBox & unnamedParam1)

Copies values from another BoundingBox.

void BoundingBox( BoundingBox && unnamedParam1)

Creates an instance of the BoundingBox class.

BoundingBox & operator=( BoundingBox && unnamedParam1)

void BoundingBox( const XMFLOAT3 & center, const XMFLOAT3 & extents) noexcept

Creates an instance of the BoundingBox class.

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

Transforms the BoundingBox.

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

Transforms the BoundingBox.

void GetCorners( XMFLOAT3 *Corners) noexcept

Retrieves the corners of the BoundingBox.

ContainmentType XM_CALLCONV Contains( FXMVECTOR Point) noexcept

Tests the whether the BoundingBox contains a specified point.

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

Test whether the BoundingBox contains a specified triangle.

ContainmentType Contains( const BoundingSphere & sh) noexcept

Tests whether the BoundingBox contains a specified BoundingSphere.

ContainmentType Contains( const BoundingBox & box) noexcept

Tests whether the BoundingBox contains another BoundingBox.

ContainmentType Contains( const BoundingOrientedBox & box) noexcept

Tests whether the BoundingBox contains the specified BoundingOrientedBox.

ContainmentType Contains( const BoundingFrustum & fr) noexcept

Tests whether the BoundingBox contains the specified BoundingFrustum.

bool Intersects( const BoundingSphere & sh) noexcept

Tests the BoundingBox for intersection with a BoundingSphere.

bool Intersects( const BoundingBox & box) noexcept

Tests the BoundingBox for intersection with another BoundingBox.

bool Intersects( const BoundingOrientedBox & box) noexcept

Test the BoundingBox for intersection with a BoundingOrientedBox.

bool Intersects( const BoundingFrustum & fr) noexcept

Test the BoundingBox for intersection with a BoundingFrustum.

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

Test the BoundingBox for intersection with a triangle.

PlaneIntersectionType XM_CALLCONV Intersects( FXMVECTOR Plane) noexcept

Test the BoundingBox for intersection with a plane.

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

Test the BoundingBox 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 BoundingBox is contained by the specified frustum.

void CreateMerged( BoundingBox & Out, const BoundingBox & b1, const BoundingBox & b2) noexcept

Creates a BoundingBox large enough to contains two specified BoundBox instances.

void CreateFromSphere( BoundingBox & Out, const BoundingSphere & sh) noexcept

Creates a BoundingBox large enough to contain the a specified BoundingSphere.

void XM_CALLCONV CreateFromPoints( BoundingBox & Out, FXMVECTOR pt1, FXMVECTOR pt2) noexcept

Creates a BoundingBox from two points.

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

Creates a BoundingBox from a list of points.

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.

Use DirectX.

Requirements

Requirement Value
Header directxcollision.h

See also

DirectXMath Library Classes