Files
XCEngine/docs/api/math/vector3/vector3-constructor.md

40 lines
592 B
Markdown
Raw Normal View History

2026-03-20 02:35:15 +08:00
# Vector3::Vector3
```cpp
Vector3() = default;
constexpr Vector3(float x, float y, float z);
```
构造一个三维向量。
**参数:**
- `x` - X 分量,默认为 0.0f
- `y` - Y 分量,默认为 0.0f
- `z` - Z 分量,默认为 0.0f
**返回:** 无
**线程安全:** ✅
**复杂度:** O(1)
**示例:**
```cpp
#include "XCEngine/Math/Vector3.h"
using namespace XCEngine::Math;
int main() {
Vector3 a;
Vector3 b(1.0f, 2.0f, 3.0f);
Vector3 c(4.5f, 5.5f, 6.5f);
return 0;
}
```
## 相关文档
- [Vector3 类总览](vector3.md) - 返回类总览