共用方式為


BoundingBox 結構 (directxcollision.h)

周框座標軸對齊物件。

語法

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;
};

成員

CORNER_COUNT

定義 BoundingBox 的點數。

Center

BoundingBox 的中心。

Extents

BoundingBox 的範圍。

void BoundingBox () noexcept

建立 BoundingBox 類別的執行個體。

void BoundingBox ( const BoundingBox & unnamedParam1)

建立 BoundingBox 類別的執行個體。

BoundingBox & operator= ( const BoundingBox & unnamedParam1)

從另一個 BoundingBox 複製值。

void BoundingBox ( BoundingBox && unnamedParam1)

建立 BoundingBox 類別的執行個體。

BoundingBox & operator=( BoundingBox && unnamedParam1)

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

建立 BoundingBox 類別的執行個體。

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

轉換 BoundingBox

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

轉換 BoundingBox。

void GetCorners ( XMFLOAT3 *Corners) noexcept

擷取 BoundingBox 的角落。

ContainmentType XM_CALLCONV Contains ( FXMVECTOR Point) noexcept

測試 BoundingBox 是否包含指定的點。

ContainmentType XM_CALLCONV 包含 ( FXMVECTOR V0、FXMVECTOR V1、FXMVECTOR V2) noexcept

測試 BoundingBox 是否包含指定的三角形。

ContainmentType contains ( const BoundingSphere & sh) noexcept

測試 BoundingBox 是否包含指定的 BoundingSphere。

ContainmentType contains ( const BoundingBox & box) noexcept

測試 BoundingBox 是否包含另一個 BoundingBox。

ContainmentType Contains ( const BoundingOrientedBox & box) noexcept

測試 BoundingBox 是否包含指定的 BoundingOrientedBox

ContainmentType Contains ( const BoundingFrustum & fr) noexcept

測試 BoundingBox 是否包含指定的 BoundingFrustum

bool Intersects ( const BoundingSphere & sh) noexcept

測試 BoundingBox 以與 BoundingSphere 交集。

bool Intersects ( const BoundingBox & box) noexcept

測試 BoundingBox,以與其他 BoundingBox 交集。

bool Intersects ( const BoundingOrientedBox & box) noexcept

測試 BoundingBox 以與 BoundingOrientedBox 交集。

bool Intersects ( const BoundingFrustum & fr) noexcept

測試 BoundingBox 以與 BoundingFrustum 交集。

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

測試 BoundingBox 以與三角形交集。

PlaneIntersectionType XM_CALLCONV intersects ( FXMVECTOR Plane) noexcept

測試 BoundingBox 以與平面交集。

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

測試 BoundingBox 以與光線交集。

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

測試 BoundingBox 是否由指定的 frustum 所包含。

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

建立足以包含兩個指定 BoundBox 實例的 BoundingBox。

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

建立大到足以包含指定 BoundingSphere 的 BoundingBox。

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

從兩點建立 BoundingBox。

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

從點清單建立 BoundingBox。

備註

平臺需求

Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012 與 Windows SDK for Windows 8。 支援 Win32 傳統型應用程式、Windows 市集應用程式和 Windows Phone 8 個應用程式。

使用 DirectX。

規格需求

   
標頭 directxcollision.h

另請參閱

DirectXMath 連結庫類別