Fixed broken references: - texture-import-settings: Fix 16 files referencing wrong overview filename - math/rectint: Fix 9 method links (rectint-* → get*, contains, intersects) - rhi/opengl/device: Fix 8 cross-references (opengl-* → */**) - resources/mesh: Fix meshsection and vertexattribute links - rhi/d3d12/sampler: Fix RHISampler reference path - math/vector3: Fix projectonplane → project-on-plane - rhi/opengl/command-list: Remove broken ClearFlag enum ref - rhi/opengl/device: Create 2 new method docs (MakeContextCurrent, GetNativeContext) - rhi/device: Fix device-info types reference All 0 broken references remaining.
1.4 KiB
1.4 KiB
RectInt
整数矩形结构体,用于像素级 2D 区域表示。
头文件: #include <XCEngine/Core/Math/Rect.h>
命名空间: XCEngine::Math
结构体定义
struct RectInt {
int32_t x = 0;
int32_t y = 0;
int32_t width = 0;
int32_t height = 0;
RectInt() = default;
RectInt(int32_t x, int32_t y, int32_t w, int32_t h);
};
构造函数
| 方法 | 描述 |
|---|---|
RectInt() |
默认构造 |
RectInt(x, y, w, h) |
从整数坐标和尺寸构造 |
边界访问
| 方法 | 返回值 | 描述 |
|---|---|---|
| GetLeft() | int32_t |
左边界 |
| GetRight() | int32_t |
右边界 |
| GetTop() | int32_t |
上边界 |
| GetBottom() | int32_t |
下边界 |
| GetPosition() | Vector2 |
位置(转换为浮点) |
| GetSize() | Vector2 |
尺寸(转换为浮点) |
| GetCenter() | Vector2 |
中心点 |
检测方法
| 方法 | 返回值 | 描述 |
|---|---|---|
| Contains(px, py) | bool |
整数坐标点检测 |
| Intersects(other) | bool |
与另一矩形相交 |