Files
XCEngine/docs/api/math/ray/getpoint.md

33 lines
640 B
Markdown
Raw Normal View History

# Ray::GetPoint
```cpp
Vector3 GetPoint(float t) const
```
2026-03-20 02:35:15 +08:00
获取射线上指定参数距离处的点。计算公式:`origin + direction * t`
**参数:**
- `t` - 沿射线方向的参数距离
**返回:** `Vector3` - 射线上的点 `origin + direction * t`
2026-03-20 02:35:15 +08:00
**线程安全:** ✅
**复杂度:** O(1)
**示例:**
```cpp
#include <XCEngine/Core/Math/Ray.h>
#include <XCEngine/Core/Math/Vector3.h>
2026-03-20 02:35:15 +08:00
using namespace XCEngine::Math;
Ray ray(Vector3(0.0f, 0.0f, 0.0f), Vector3(1.0f, 0.0f, 0.0f));
Vector3 point = ray.GetPoint(100.0f); // point = (100, 0, 0)
```
2026-03-20 02:35:15 +08:00
## 相关文档
- [Ray 类总览](ray.md) - 返回类总览