docs: update math API docs
This commit is contained in:
33
docs/api/math/ray/ray-constructor.md
Normal file
33
docs/api/math/ray/ray-constructor.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Ray::Ray (构造函数)
|
||||
|
||||
```cpp
|
||||
Ray(const Vector3& origin, const Vector3& direction)
|
||||
```
|
||||
|
||||
从起点和方向构造射线。
|
||||
|
||||
**参数:**
|
||||
- `origin` - 射线起点
|
||||
- `direction` - 射线方向(构造时会被归一化)
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Ray.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
Ray ray(Vector3(0.0f, 0.0f, 0.0f), Vector3(1.0f, 0.0f, 0.0f));
|
||||
// direction 已被归一化
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Ray 类总览](ray.md) - 返回类总览
|
||||
Reference in New Issue
Block a user