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 转换 ( BoundingBox & Out,FXMMATRIX M) noexcept

转换 BoundingBox

void XM_CALLCONV 转换 ( BoundingBox & Out、float Scale、FXMVECTOR 旋转、FXMVECTOR 转换) noexcept

转换 BoundingBox。

void GetCorners ( XMFLOAT3 *Corners) noexcept

检索 BoundingBox 的角。

ContainmentType XM_CALLCONV 包含 ( FXMVECTOR 点) noexcept

测试 BoundingBox 是否包含指定的点。

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

测试 BoundingBox 是否包含指定的三角形。

ContainmentType Contains ( const BoundingSphere & sh) noexcept

测试 BoundingBox 是否包含指定的 BoundingSphere。

ContainmentType 包含 ( const BoundingBox & 框) noexcept

测试 BoundingBox 是否包含另一个 BoundingBox。

ContainmentType 包含 ( const BoundingOrientedBox & 框) noexcept

测试 BoundingBox 是否包含指定的 BoundingOrientedBox

ContainmentType Contains ( const BoundingFrustum & fr) noexcept

测试 BoundingBox 是否包含指定的 BoundingFrustum

bool Intersects ( const BoundingSphere & sh) noexcept

测试 BoundingBoxBoundingSphere 的交集。

bool Intersects ( const BoundingBox & box) noexcept

测试 BoundingBox 与另一个 BoundingBox 的交集。

bool Intersects ( const BoundingOrientedBox & box) noexcept

测试 BoundingBoxBoundingOrientedBox 的交集。

bool Intersects ( const BoundingFrustum & fr) noexcept

测试 BoundingBoxBoundingFrustum 的交集。

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 是否包含在指定的视锥中。

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 库类