refactor(docs): Fix broken links across multiple modules
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.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# GetMasterVolume
|
||||
|
||||
**所属类**: `AudioListenerComponent`
|
||||
|
||||
**头文件**: `XCEngine/Core/Components/AudioListenerComponent.h`
|
||||
|
||||
**描述**: 获取音频监听器的主音量。
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
float GetMasterVolume() const;
|
||||
```
|
||||
|
||||
## 返回值
|
||||
|
||||
| 类型 | 描述 |
|
||||
|------|------|
|
||||
| `float` | 当前主音量,范围 0.0 到 1.0 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Components/AudioListenerComponent.h>
|
||||
|
||||
using namespace XCEngine::Components;
|
||||
|
||||
void PrintListenerVolume(AudioListenerComponent* listener) {
|
||||
float volume = listener->GetMasterVolume();
|
||||
printf("Master volume: %.2f\n", volume);
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [AudioListenerComponent](audio-listener-component.md) - 音频监听器组件
|
||||
- [SetMasterVolume](set-master-volume.md) - 设置主音量
|
||||
@@ -0,0 +1,36 @@
|
||||
# SetMasterVolume
|
||||
|
||||
**所属类**: `AudioListenerComponent`
|
||||
|
||||
**头文件**: `XCEngine/Core/Components/AudioListenerComponent.h`
|
||||
|
||||
**描述**: 设置音频监听器的主音量。
|
||||
|
||||
## 函数签名
|
||||
|
||||
```cpp
|
||||
void SetMasterVolume(float volume);
|
||||
```
|
||||
|
||||
## 参数
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `volume` | `float` | 主音量,范围 0.0 到 1.0 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Components/AudioListenerComponent.h>
|
||||
|
||||
using namespace XCEngine::Components;
|
||||
|
||||
void SetListenerVolume(AudioListenerComponent* listener) {
|
||||
listener->SetMasterVolume(0.8f); // 80% 音量
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [AudioListenerComponent](audio-listener-component.md) - 音频监听器组件
|
||||
- [GetMasterVolume](get-master-volume.md) - 获取主音量
|
||||
@@ -44,13 +44,13 @@ device->Initialize(desc);
|
||||
### 使用资源管理器
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Resources/ResourceManager.h>
|
||||
#include <XCEngine/Resources/Resources.h>
|
||||
|
||||
// 加载纹理
|
||||
auto texture = Resources::ResourceManager::Get().Load<Resources::Texture>("textures/player.png");
|
||||
auto texture = XCEngine::Resources::ResourceManager::Get().Load<XCEngine::Resources::Texture>("textures/player.png");
|
||||
|
||||
// 加载网格
|
||||
auto mesh = Resources::ResourceManager::Get().Load<Resources::Mesh>("models/player.fbx");
|
||||
auto mesh = XCEngine::Resources::ResourceManager::Get().Load<XCEngine::Resources::Mesh>("models/player.fbx");
|
||||
```
|
||||
|
||||
### 日志记录
|
||||
@@ -65,32 +65,34 @@ XE_LOG(Debug::LogCategory::Rendering, Debug::LogLevel::Info, "Render started");
|
||||
### 数学运算
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Matrix4.h>
|
||||
#include <XCEngine/Core/Math/Matrix4.h>
|
||||
|
||||
// 创建变换矩阵
|
||||
Math::Matrix4 transform = Math::Matrix4::TRS(position, rotation, scale);
|
||||
Math::Matrix4x4 transform = Math::Matrix4x4::TRS(position, rotation, scale);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 文档统计
|
||||
|
||||
> ⚠️ 注意:以下统计数据为近似值,部分 RHI 伪造文档待删除后需重新统计。
|
||||
|
||||
| 模块 | 文档数量 |
|
||||
|------|----------|
|
||||
| RHI 抽象层 | 17 |
|
||||
| D3D12 后端 | 24 |
|
||||
| OpenGL 后端 | 14 |
|
||||
| Math | 17 |
|
||||
| Resources | 17 |
|
||||
| Threading | 10 |
|
||||
| Memory | 6 |
|
||||
| Debug | 9 |
|
||||
| Core | 6 |
|
||||
| Containers | 4 |
|
||||
| Audio | 10 |
|
||||
| Components | 36 |
|
||||
| Scene | 19 |
|
||||
| **总计** | **143** |
|
||||
| RHI 抽象层 | ~15 (含待删除伪造文档) |
|
||||
| D3D12 后端 | ~20 |
|
||||
| OpenGL 后端 | ~25 (含待删除伪造文档) |
|
||||
| Math | ~15 |
|
||||
| Resources | ~20 |
|
||||
| Threading | ~15 |
|
||||
| Memory | ~12 |
|
||||
| Debug | ~10 |
|
||||
| Core | ~5 |
|
||||
| Containers | ~4 |
|
||||
| Audio | ~20 |
|
||||
| Components | ~50 |
|
||||
| Scene | ~10 |
|
||||
| **总计** | **~220 (待精确统计)** |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ Bounds(const Vector3& center, const Vector3& size)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Contains(const Vector3& point) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ void Encapsulate(const Bounds& bounds)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ void Expand(const Vector3& amount)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ Vector3 GetClosestPoint(const Vector3& point) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ Vector3 GetMax() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ Vector3 GetMin() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ float GetVolume() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Intersects(const Bounds& other) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ void SetMinMax(const Vector3& min, const Vector3& max)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ Box(const Vector3& center, const Vector3& extents)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Box.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Box.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Contains(const Vector3& point) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Box.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Box.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ Vector3 GetMax() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Box.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Box.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ Vector3 GetMin() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Box.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Box.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ bool Intersects(const Box& other) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Box.h>
|
||||
#include <XCEngine/Core/Math/Box.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ bool Intersects(const Ray& ray, float& t) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Box.h>
|
||||
#include <XCEngine/Math/Ray.h>
|
||||
#include <XCEngine/Core/Math/Box.h>
|
||||
#include <XCEngine/Core/Math/Ray.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Intersects(const Sphere& sphere) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Box.h>
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Box.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Contains(const Bounds& bounds) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Frustum.h>
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Frustum.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
|
||||
void CheckBoundsInFrustum(const Frustum& frustum, const Bounds& bounds) {
|
||||
if (frustum.Contains(bounds)) {
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Contains(const Vector3& point) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Frustum.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Frustum.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
void CheckPointInFrustum(const Frustum& frustum, const Vector3& point) {
|
||||
if (frustum.Contains(point)) {
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Contains(const Sphere& sphere) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Frustum.h>
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Frustum.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
|
||||
void CheckSphereInFrustum(const Frustum& frustum, const Sphere& sphere) {
|
||||
if (frustum.Contains(sphere)) {
|
||||
|
||||
@@ -20,8 +20,8 @@ bool Intersects(const Bounds& bounds) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Frustum.h>
|
||||
#include <XCEngine/Math/Bounds.h>
|
||||
#include <XCEngine/Core/Math/Frustum.h>
|
||||
#include <XCEngine/Core/Math/Bounds.h>
|
||||
|
||||
void FrustumCullingExample(const Frustum& frustum, const std::vector<Bounds>& objectBounds) {
|
||||
for (const auto& bounds : objectBounds) {
|
||||
|
||||
@@ -20,8 +20,8 @@ bool Intersects(const Sphere& sphere) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Frustum.h>
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Frustum.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
|
||||
void CheckSphereIntersection(const Frustum& frustum, const Sphere& sphere) {
|
||||
if (frustum.Intersects(sphere)) {
|
||||
|
||||
@@ -9,7 +9,7 @@ constexpr float DEG_TO_RAD = PI / 180.0f;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float angleDegrees = 90.0f;
|
||||
float angleRadians = angleDegrees * Math::DEG_TO_RAD;
|
||||
|
||||
@@ -9,7 +9,7 @@ float Degrees(float radians);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float radians = Math::HALF_PI;
|
||||
float degrees = Math::Degrees(radians);
|
||||
|
||||
@@ -9,7 +9,7 @@ constexpr float EPSILON = 1e-6f;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float a = 0.1f + 0.2f;
|
||||
float b = 0.3f;
|
||||
|
||||
@@ -9,7 +9,7 @@ constexpr float FLOAT_MAX = 3.402823466e+38f;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float maxDistance = FLOAT_MAX;
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**类型**: `header`
|
||||
|
||||
**头文件**: `XCEngine/Math/Math.h`
|
||||
**头文件**: `XCEngine/Core/Math/Math.h`
|
||||
|
||||
**描述**: 数学库常量和辅助函数头文件。
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ constexpr float HALF_PI = 1.57079632679489661923f;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float ninetyDegreesRadians = HALF_PI;
|
||||
```
|
||||
|
||||
@@ -11,7 +11,7 @@ constexpr float PI = 3.14159265358979323846f;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float circumference = 2.0f * PI * radius;
|
||||
float area = PI * radius * radius;
|
||||
|
||||
@@ -9,7 +9,7 @@ constexpr float RAD_TO_DEG = 180.0f / PI;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float radians = Math::HALF_PI;
|
||||
float degrees = radians * Math::RAD_TO_DEG;
|
||||
|
||||
@@ -9,7 +9,7 @@ float Radians(float degrees);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float degrees = 90.0f;
|
||||
float radians = Math::Radians(degrees);
|
||||
|
||||
@@ -9,7 +9,7 @@ constexpr float TWO_PI = 6.28318530717958647692f;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
float fullCircleRadians = TWO_PI;
|
||||
```
|
||||
|
||||
@@ -44,8 +44,10 @@ Math 模块提供了一套完整的图形数学库,包括向量、矩阵、四
|
||||
| [Sphere](sphere/sphere.md) | `Sphere.h` | 球体 |
|
||||
| [Box](box/box.md) | `Box.h` | 盒子 |
|
||||
| [Bounds](bounds/bounds.md) | `Bounds.h` | 轴对齐包围盒 |
|
||||
| [OBB](obb/obb.md) | `AABB.h` | 有向包围盒 |
|
||||
| [Frustum](frustum/frustum.md) | `Frustum.h` | 视锥体 |
|
||||
| [Rect](rect/rect.md) | `Rect.h` | 二维矩形 |
|
||||
| [RectInt](rectint/rectint.md) | `Rect.h` | 整数矩形 |
|
||||
|
||||
## 常量定义
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ void Decompose(Vector3& translation, Quaternion& rotation, Vector3& scale) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Math/Quaternion.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Quaternion.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ float Determinant() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ Quaternion GetRotation() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Quaternion.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Quaternion.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ Vector3 GetScale() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ Vector3 GetTranslation() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ static Matrix4x4 Identity()
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Matrix4x4 Inverse() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ static Matrix4x4 LookAt(const Vector3& eye, const Vector3& target, const Vector3
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ Vector3 MultiplyPoint(const Vector3& v) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ Vector3 MultiplyVector(const Vector3& v) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ const float* operator[](int row) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ Vector4 operator*(const Vector4& v) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ static Matrix4x4 Orthographic(float left, float right, float bottom, float top,
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ static Matrix4x4 Perspective(float fov, float aspect, float near, float far)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ static Matrix4x4 Rotation(const Quaternion& q)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Quaternion.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Quaternion.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ static Matrix4x4 RotationX(float radians)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ static Matrix4x4 RotationY(float radians)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ static Matrix4x4 RotationZ(float radians)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ static Matrix4x4 Scale(const Vector3& v)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ static Matrix4x4 Translation(const Vector3& v)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Matrix4x4 Transpose() const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ static Matrix4x4 TRS(const Vector3& translation, const Quaternion& rotation, con
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Math/Quaternion.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Quaternion.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ static Matrix4x4 Zero()
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
#include "XCEngine/Core/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**类型**: `struct`
|
||||
|
||||
**头文件**: `XCEngine/Math/AABB.h`
|
||||
**头文件**: `XCEngine/Core/Math/AABB.h`
|
||||
|
||||
**描述**: 定向包围盒,支持任意方向旋转的盒状包围体
|
||||
|
||||
@@ -28,9 +28,9 @@ OBB 常用于碰撞检测、剔除运算和物理模拟等场景。
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include "AABB.h"
|
||||
#include "Vector3.h"
|
||||
#include "Matrix4.h"
|
||||
#include <XCEngine/Core/Math/AABB.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Matrix4.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Plane()
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Plane.h>
|
||||
#include <XCEngine/Core/Math/Plane.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ Plane(const Vector3& normal, float distance)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Plane.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Plane.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ static Plane FromPoints(const Vector3& a, const Vector3& b, const Vector3& c)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Plane.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Plane.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ Vector3 GetClosestPoint(const Vector3& point) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Plane.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Plane.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ float GetDistanceToPoint(const Vector3& point) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Plane.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Plane.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
#include <cstdio>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
@@ -18,8 +18,8 @@ bool GetSide(const Vector3& point) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Plane.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Plane.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ bool Intersects(const Sphere& sphere) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Plane.h>
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Plane.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ float Dot(const Quaternion& other) const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ static Quaternion FromAxisAngle(const Vector3& axis, float radians);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ static Quaternion FromEulerAngles(const Vector3& euler);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ static Quaternion FromRotationMatrix(const Matrix4x4& matrix);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Matrix4.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Matrix4.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ static Quaternion Identity();
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Quaternion Inverse() const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ static Quaternion LookRotation(const Vector3& forward, const Vector3& up = Vecto
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ float Magnitude() const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ static Quaternion Normalize(const Quaternion& q);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Quaternion Normalized() const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ Vector3 operator*(const Quaternion& q, const Vector3& v);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ static Quaternion Slerp(const Quaternion& a, const Quaternion& b, float t);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ Vector3 ToEulerAngles() const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Math/Math.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Math.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ Matrix4x4 ToMatrix4x4() const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Matrix4.h>
|
||||
#include <XCEngine/Core/Math/Quaternion.h>
|
||||
#include <XCEngine/Core/Math/Matrix4.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ Vector3 GetPoint(float t) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Ray.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Ray.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ bool Intersects(const Box& box, float& t) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Ray.h>
|
||||
#include <XCEngine/Math/Box.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Ray.h>
|
||||
#include <XCEngine/Core/Math/Box.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ bool Intersects(const Plane& plane, float& t) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Ray.h>
|
||||
#include <XCEngine/Math/Plane.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Ray.h>
|
||||
#include <XCEngine/Core/Math/Plane.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ bool Intersects(const Sphere& sphere, float& t) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Ray.h>
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Ray.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Ray() = default
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Ray.h>
|
||||
#include <XCEngine/Core/Math/Ray.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ Ray(const Vector3& origin, const Vector3& direction)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Ray.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Ray.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ bool Contains(const Vector2& point) const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Rect.h"
|
||||
#include "XCEngine/Core/Math/Rect.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
浮点矩形结构体,用于 2D 区域表示。
|
||||
|
||||
**头文件:** `#include <XCEngine/Math/Rect.h>`
|
||||
**头文件:** `#include <XCEngine/Core/Math/Rect.h>`
|
||||
|
||||
**命名空间:** `XCEngine::Math`
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ void SetPosition(const Vector2& position);
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Rect.h"
|
||||
#include "XCEngine/Math/Vector2.h"
|
||||
#include "XCEngine/Core/Math/Rect.h"
|
||||
#include "XCEngine/Core/Math/Vector2.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
整数矩形结构体,用于像素级 2D 区域表示。
|
||||
|
||||
**头文件:** `#include <XCEngine/Math/Rect.h>`
|
||||
**头文件:** `#include <XCEngine/Core/Math/Rect.h>`
|
||||
|
||||
**命名空间:** `XCEngine::Math`
|
||||
|
||||
@@ -31,20 +31,20 @@ struct RectInt {
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| [GetLeft()](rectint-getleft.md) | `int32_t` | 左边界 |
|
||||
| [GetRight()](rectint-getright.md) | `int32_t` | 右边界 |
|
||||
| [GetTop()](rectint-gettop.md) | `int32_t` | 上边界 |
|
||||
| [GetBottom()](rectint-getbottom.md) | `int32_t` | 下边界 |
|
||||
| [GetPosition()](rectint-getposition.md) | `Vector2` | 位置(转换为浮点) |
|
||||
| [GetSize()](rectint-getsize.md) | `Vector2` | 尺寸(转换为浮点) |
|
||||
| [GetCenter()](rectint-getcenter.md) | `Vector2` | 中心点 |
|
||||
| [GetLeft()](getleft.md) | `int32_t` | 左边界 |
|
||||
| [GetRight()](getright.md) | `int32_t` | 右边界 |
|
||||
| [GetTop()](gettop.md) | `int32_t` | 上边界 |
|
||||
| [GetBottom()](getbottom.md) | `int32_t` | 下边界 |
|
||||
| [GetPosition()](getposition.md) | `Vector2` | 位置(转换为浮点) |
|
||||
| [GetSize()](getsize.md) | `Vector2` | 尺寸(转换为浮点) |
|
||||
| [GetCenter()](getcenter.md) | `Vector2` | 中心点 |
|
||||
|
||||
## 检测方法
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| [Contains(px, py)](rectint-contains.md) | `bool` | 整数坐标点检测 |
|
||||
| [Intersects(other)](rectint-intersects.md) | `bool` | 与另一矩形相交 |
|
||||
| [Contains(px, py)](contains.md) | `bool` | 整数坐标点检测 |
|
||||
| [Intersects(other)](intersects.md) | `bool` | 与另一矩形相交 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Contains(const Vector3& point) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ bool Intersects(const Sphere& other) const
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ Sphere(const Vector3& center, float radius)
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ Sphere()
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Sphere.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Core/Math/Sphere.h>
|
||||
#include <XCEngine/Core/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ Vector3 InverseTransformDirection(const Vector3& direction) const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Transform.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Transform.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ Vector3 InverseTransformPoint(const Vector3& point) const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Transform.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Transform.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ Transform Inverse() const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Transform.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Transform.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ Transform operator*(const Transform& other) const;
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Transform.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Transform.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**类型**: `enum class`
|
||||
|
||||
**头文件**: `XCEngine/Math/Transform.h`
|
||||
**头文件**: `XCEngine/Core/Math/Transform.h`
|
||||
|
||||
## 概述
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Transform.h"
|
||||
#include "XCEngine/Math/Vector3.h"
|
||||
#include "XCEngine/Core/Math/Transform.h"
|
||||
#include "XCEngine/Core/Math/Vector3.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user