Class Info |
|---|
class Plane 平面类。包含平面类对象的赋值、比较操作,及设置平面法向量、原点到平面距离等。 |
Qualifier and Type |
Method Name and Description |
|---|---|
| 重载赋值运算符,使用Plane类对象给当前对象赋值。 |
|
bool |
operator==(const Plane& plane) const 重载==运算符,比较当前对象和指定Plane类对象是否相等,相等返回true,不相等返回false。 |
bool |
operator!=(const Plane& plane) const 重载!=运算符,比较当前对象和指定Plane类对象是否不相等,不相等返回true,相等返回false。 |
void |
Set(const Vector3& normal, f32 distance) 设置平面的法向量和原点到平面的距离。 |
void |
Set(const Vector3& normal, const Vector3& point) 设置平面的法线,并根据指定点的坐标,计算出原点到平面的距离。 |
void |
Set(const Vector3& point1, const Vector3& point2, const Vector3& point3) 三点确定一个平面,根据3个点计算出平面的法向量及原点到平面的距离。 |
ToString() const Plane类型转字符串类型,形如“Plane(Normal: (a, b, c);Distance: 原点到平面距离)”。 |
Parameters
Name |
Description |
|---|---|
other |
给当前对象赋值的Plane类对象。 |
Returns
Type |
Description |
|---|---|
返回赋值后对当前对象的引用。 |
Parameters
Name |
Description |
|---|---|
plane |
与当前对象进行比较的Plane类对象。 |
Returns
Type |
Description |
|---|---|
bool |
|
Method |
|---|
bool operator!=(const Plane& plane) const 重载!=运算符,比较当前对象和指定Plane类对象是否不相等,不相等返回true,相等返回false。 |
Parameters
Name |
Description |
|---|---|
plane |
与当前对象进行比较的Plane类对象。 |
Returns
Type |
Description |
|---|---|
bool |
|
Parameters
Name |
Description |
|---|---|
normal |
待设置的法向量。 |
distance |
原点到平面的距离。 |
Parameters
Name |
Description |
|---|---|
normal |
待设置的法向量。 |
point |
平面上某一点的坐标。 |