Files
XCEngine/docs/api/math/vector2/operator-add.md

534 B

Vector2::operator+

Vector2 operator+(const Vector2& other) const

向量加法,将当前向量与另一个向量相加。

参数:

  • other - 要相加的向量

返回: Vector2 - 相加结果向量

线程安全:

复杂度: O(1)

示例:

Vector2 a(1.0f, 2.0f);
Vector2 b(3.0f, 4.0f);
Vector2 c = a + b;  // (4.0f, 6.0f)

相关文档