- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
25 lines
487 B
Markdown
25 lines
487 B
Markdown
# Vector2::Lerp
|
||
|
||
```cpp
|
||
static Vector2 Lerp(const Vector2& a, const Vector2& b, float t)
|
||
```
|
||
|
||
在线性插值两个向量之间。参数 t 会在 [0, 1] 范围内被限制。
|
||
|
||
**参数:**
|
||
- `a` - 起始向量
|
||
- `b` - 结束向量
|
||
- `t` - 插值因子,0 返回 a,1 返回 b
|
||
|
||
**返回:** `Vector2` - 插值结果
|
||
|
||
**复杂度:** O(1)
|
||
|
||
**示例:**
|
||
|
||
```cpp
|
||
Vector2 start(0.0f, 0.0f);
|
||
Vector2 end(10.0f, 10.0f);
|
||
Vector2 mid = Vector2::Lerp(start, end, 0.5f); // (5.0f, 5.0f)
|
||
```
|