21 lines
303 B
Markdown
21 lines
303 B
Markdown
|
|
# Plane::Intersects
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
bool Intersects(const Sphere& sphere) const
|
||
|
|
```
|
||
|
|
|
||
|
|
检测平面是否与球体相交。
|
||
|
|
|
||
|
|
**参数:**
|
||
|
|
- `sphere` - 要检测的球体
|
||
|
|
|
||
|
|
**返回:** `bool` - true 表示相交
|
||
|
|
|
||
|
|
**复杂度:** O(1)
|
||
|
|
|
||
|
|
**示例:**
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
if (plane.Intersects(sphere)) { /* collision */ }
|
||
|
|
```
|