合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
Class Info |
|---|
class AABB 描述网格包围盒的类,包围盒为一个立方体。包括包围盒对象间的赋值、比较,获取包围盒最小、最大坐标、中心点坐标、角坐标等。 |
Destructor Name |
|---|
~AABB() 析构函数,释放内存。 |
Qualifier and Type |
Method Name and Description |
|---|---|
AABB& |
重载赋值运算符,使用AABB类对象给当前对象赋值。 |
bool |
operator==(const AABB& other) const 重载==运算符,比较当前对象与指定AABB类对象是否相等,相等返回true,不相等返回false。 |
bool |
operator!=(const AABB& other) const 重载!=运算符,比较当前对象与指定AABB类对象是否不相等,不相等返回true,相等返回false。 |
GetMinDistanceVertex(const Vector3& normal) const 获取AABB包围盒最远离指定方向上的顶点。 |
|
GetMaxDistanceVertex(const Vector3& normal) const 获取AABB包围盒最靠近指定方向上的顶点。 |
|
const Vector3& |
GetMinimum() const 获取包围盒的坐标最小值。 |
const Vector3& |
GetMaximum() const 获取包围盒的坐标最大值。 |
void |
SetMinimum(const Vector3& vec) 设置包围盒的坐标最小值。 |
void |
SetMaximum(const Vector3& vec) 设置包围盒的坐标最大值。 |
const Vector3* |
GetCorners() const 获取包围盒八个角的坐标。 |
GetCenter() const 获取包围盒中心点的坐标。 |
|
GetSize() const 获取包围盒三个维度上的大小。 |
|
GetHalfSize() const 获取包围盒三个维度上一半的大小。 |
|
void |
AddInternalPoint(const Vector3& p) 增加包围盒中的点,并根据该点的坐标更新包围盒的坐标最小值和最大值。 |
void |
AddInternalBox(const AABB& b) 增加一个包围盒,根据该包围盒的坐标最小值、最大值,更新当前包围盒的坐标最小值、最大值。 |
ToString() const 包围盒类型转字符串类型,形如“(包围盒最小值,包围盒最大值)”。 |
|
bool |
Contains(const AABB& other) const 是否包含在包围盒中。 |
Constructor |
|---|
AABB() 构造函数,初始化包围盒坐标最小值、坐标最大值、指向八个角坐标的指针。 |
Constructor |
|---|
AABB(const AABB& other) 拷贝构造函数。 |
Parameters
Name |
Description |
|---|---|
other |
已存的AABB类对象引用。 |
Destructor |
|---|
~AABB() 析构函数,释放内存。 |
Parameters
Name |
Description |
|---|---|
other |
用于赋值的AABB类对象。 |
Returns
Type |
Description |
|---|---|
AABB& |
返回赋值后对当前对象的引用。 |
Parameters
Name |
Description |
|---|---|
other |
与当前对象进行比较的AABB类对象的引用。 |
Returns
Type |
Description |
|---|---|
bool |
|
Parameters
Name |
Description |
|---|---|
other |
与当前对象进行比较的AABB类对象的引用。 |
Returns
Type |
Description |
|---|---|
bool |
|
Parameters
Name |
Description |
|---|---|
normal |
三维的方向向量。 |
Returns
Type |
Description |
|---|---|
获取AABB包围盒最远离指定方向上的顶点。 |
Parameters
Name |
Description |
|---|---|
normal |
三维的方向向量。 |
Returns
Type |
Description |
|---|---|
获取AABB包围盒最靠近指定方向上的顶点。 |
Method |
|---|
const Vector3& GetMinimum() const 获取包围盒的坐标最小值。 |
Returns
Type |
Description |
|---|---|
const Vector3& |
返回包围盒的坐标最小值。 |
Method |
|---|
const Vector3& GetMaximum() const 获取包围盒的坐标最大值。 |
Returns
Type |
Description |
|---|---|
const Vector3& |
返回包围盒的坐标最大值。 |
Method |
|---|
void SetMinimum(const Vector3& vec) 设置包围盒的坐标最小值。 |
Parameters
Name |
Description |
|---|---|
vec |
三维向量表示的XYZ坐标。 |
Method |
|---|
void SetMaximum(const Vector3& vec) 设置包围盒的坐标最大值。 |
Parameters
Name |
Description |
|---|---|
vec |
三维向量表示的XYZ坐标。 |
Method |
|---|
const Vector3* GetCorners() const 获取包围盒八个角坐标。 |
Returns
Type |
Description |
|---|---|
const Vector3* |
返回指向包围盒八个角坐标的指针。 |
Method |
|---|
Vector3 GetSize() const 获取包围盒三个维度上的大小。 |
Returns
Type |
Description |
|---|---|
返回包围盒三个维度上的大小,返回值形如“(宽度,高度,深度)”。 |
Method |
|---|
Vector3 GetHalfSize() const 获取包围盒三个维度上一半的大小。 |
Returns
Type |
Description |
|---|---|
返回包围盒三个维度上一半的大小,返回值形如“(宽度,高度,深度)”。 |
Method |
|---|
void AddInternalPoint(const Vector3& p) 增加包围盒中的点,并根据该点的坐标更新包围盒的坐标最小值和最大值。 |
Parameters
Name |
Description |
|---|---|
p |
待添加点的三维坐标。 |
Method |
|---|
void AddInternalBox(const AABB& b) 增加一个包围盒,根据该包围盒的坐标最小值、最大值,更新当前包围盒的坐标最小值、最大值。 |
Parameters
Name |
Description |
|---|---|
b |
待添加的包围盒。 |
Method |
|---|
bool Contains(const AABB& other) const 是否包含在包围盒中。 |
Parameters
Name |
Description |
|---|---|
other |
待判断的物体。 |
Returns
Type |
Description |
|---|---|
bool |
|