Files
XCEngine/docs/api/math/vector2/operator-mul-assign.md

498 B

Vector2::operator*=

Vector2& operator*=(float scalar)

向量乘法赋值,将当前向量乘以标量。

参数:

  • scalar - 标量值

返回: Vector2& - 引用到修改后的当前向量

线程安全:

复杂度: O(1)

示例:

Vector2 v(2.0f, 3.0f);
v *= 2.0f;  // v = (4.0f, 6.0f)

相关文档