Files
XCEngine/docs/api/math/vector3/lerp.md

31 lines
601 B
Markdown
Raw Normal View History

# Vector3::Lerp
```cpp
static Vector3 Lerp(const Vector3& a, const Vector3& b, float t)
```
在线性插值两个向量之间。参数 t 会在 [0, 1] 范围内被限制。
**参数:**
- `a` - 起始向量
- `b` - 结束向量
- `t` - 插值因子0 返回 a1 返回 b
**返回:** `Vector3` - 插值结果
2026-03-20 02:35:15 +08:00
**线程安全:** ✅
**复杂度:** O(1)
**示例:**
```cpp
Vector3 start(0.0f, 0.0f, 0.0f);
Vector3 end(10.0f, 10.0f, 10.0f);
Vector3 mid = Vector3::Lerp(start, end, 0.5f); // (5.0f, 5.0f, 5.0f)
```
2026-03-20 02:35:15 +08:00
## 相关文档
- [Vector3 类总览](vector3.md) - 返回类总览