19 lines
284 B
Markdown
19 lines
284 B
Markdown
# RectInt::GetCenter
|
|
|
|
```cpp
|
|
Vector2 GetCenter() const
|
|
```
|
|
|
|
获取矩形中心点(转换为浮点)。
|
|
|
|
**返回:** `Vector2` - 中心点坐标
|
|
|
|
**复杂度:** O(1)
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
RectInt rect(10, 20, 100, 50);
|
|
Vector2 center = rect.GetCenter(); // (60.0f, 45.0f)
|
|
```
|