docs: update math API docs

This commit is contained in:
2026-03-20 02:35:15 +08:00
parent e165dbea1c
commit c5b17239ca
243 changed files with 5307 additions and 1327 deletions

View File

@@ -4,17 +4,37 @@
bool Contains(const Vector3& point) const
```
检测点是否在球体内(包括表面)。
检测点是否在球体内(包括球体表面)。使用平方距离比较避免开平方运算。
**参数:**
- `point` - 要检测的点
**返回:** `bool` - true 表示点在球体内
**返回:** `bool` - true 表示点在球体内(包括表面)
**线程安全:**
**复杂度:** O(1)
**示例:**
```cpp
if (sphere.Contains(point)) { /* point inside */ }
#include <XCEngine/Math/Sphere.h>
#include <XCEngine/Math/Vector3.h>
using namespace XCEngine::Math;
Sphere sphere(Vector3(0.0f, 0.0f, 0.0f), 1.0f);
Vector3 inside(0.5f, 0.0f, 0.0f);
if (sphere.Contains(inside)) {
}
Vector3 outside(2.0f, 0.0f, 0.0f);
if (!sphere.Contains(outside)) {
}
```
## 相关文档
- [Sphere](sphere.md) - 返回类总览
- [Intersects](intersects.md) - 球体相交检测