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 & 运算符= ( 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 包含 ( FXMVECTOR 点) noexcept

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

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

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

ContainmentType 包含 ( const BoundingSphere & sh) noexcept

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

ContainmentType 包含 ( const BoundingBox & 框) noexcept

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

ContainmentType 包含 ( const BoundingOrientedBox & 框) noexcept

测试 BoundingBox 是否包含指定的 BoundingOrientedBox

ContainmentType 包含 ( 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 平面) 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

创建足够大的 BoundingBox,以包含两个指定的 BoundBox 实例。

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

创建足够大的 BoundingBox,以包含指定的 BoundingSphere。

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。

注解

平台要求

使用适用于 Windows 8 的 Windows SDK 的 Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012。 支持 Win32 桌面应用、Windows 应用商店应用和 Windows Phone 8 个应用。

使用 DirectX。

要求

   
标头 directxcollision.h

另请参阅

DirectXMath 库类