# UE5 项目快速启动指南 ## 已配置内容 ✅ **Cesium ion Token** - 已配置 - Token: `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...` ## 项目结构 ``` unreal/ ├── Config/ │ └── PlanetConfig.ini # Cesium ion 配置 ├── Content/ │ ├── Blueprints/ # 蓝图文件 (在 UE5 中创建) │ ├── Materials/ # 材质文件 │ ├── Widgets/ # UI 控件 │ └── Levels/ # 关卡文件 └── Source/ └── PlanetAPI/ # C++ 源码 (在 UE5 中编译) ``` ## 启动步骤 ### 1. 创建 UE5 项目 ```bash # 方式一: 从 Epic Games Launcher # 1. 打开 Epic Games Launcher # 2. 选择 Unreal Engine 5.3+ # 3. 点击 "Games" → "Blank" → "Blueprint" # 4. 创建名为 "Planet" 的项目 # 5. 将项目保存到 /home/ray/dev/linkong/planet/unreal/ ``` ### 2. 安装 Cesium 插件 在 UE5 编辑器中: 1. 打开 **Edit** → **Plugins** 2. 搜索 **Cesium for Unreal** 3. 点击 **Enable** 4. 重启编辑器 ### 3. 配置 Cesium ion Token **方式 A: 通过 UE5 编辑器** 1. 打开 **Edit** → **Project Settings** 2. 搜索 **Cesium** 3. 在 **Cesium ion** 部分输入 Token: ``` eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI4YWFhYTQ5Zi02YTBlLTRhNmYtOTYyZC02NjgyYzQwMWY1YmMiLCJpZCI6Mzg5NDMzLCJpYXQiOjE3NzA3ODE1ODN9.yF-06K39B_8SkwMCQVuztAwdXDlRlumT33TVOYhQGqs ``` **方式 B: 通过配置文件** - 配置文件已保存到: `Config/PlanetConfig.ini` ### 4. 创建主场景 1. 在 UE5 中创建新关卡: **File** → **New Level** → **Default** 2. 从 **Cesium** 面板拖入 **Cesium World Terrain** 3. 添加 **Cesium Sun Sky** 4. 保存为 `Content/Levels/Main.umap` ### 5. 创建数据可视化蓝图 创建以下蓝图类 (在 UE5 中): | 蓝图类 | 用途 | |--------|------| | BP_GlobeController | 地球控制器,管理 Cesium | | BP_Supercomputer | TOP500 超算标记 | | BP_GPUCluster | GPU 集群标记 | | BP_SubmarineCable | 海缆连接线 | | BP_DataFlow | 数据流向粒子 | ### 6. 连接后端 API 在蓝图中使用 HTTP 请求获取数据: ```cpp // HTTP 请求示例 (在 UE5 蓝图中使用 HTTP Client 节点) GET http://localhost:8000/api/v1/collected?source=top500 ``` WebSocket 实时更新: ``` ws://localhost:8000/ws ``` ## 数据格式 ### TOP500 超算数据 ```json { "id": "top500_1", "name": "Frontier", "location": { "latitude": 33.7756, "longitude": -84.3962, "altitude": 0 }, "performance": 1682.65, "cores": 8730112, "country": "US" } ``` ### 海缆数据 ```json { "id": "cable_1", "name": "SEA-ME-WE 4", "path": [ {"latitude": 1.3521, "longitude": 103.8198}, {"latitude": 3.1390, "longitude": 101.6869} ], "bandwidth": 1000 } ``` ## 快速测试 1. 启动后端服务: ```bash cd /home/ray/dev/linkong/planet docker restart planet_backend_new ``` 2. 打开 UE5 项目 3. 在蓝图中添加 HTTP 请求获取数据 4. 在场景中放置数据标记 5. 运行并测试 ## 注意事项 ⚠️ **Token 安全**: - 你的 Cesium ion token 已保存在配置文件中 - 建议不要将 token 上传到公开的代码仓库 - 可以通过环境变量管理敏感信息 ⚠️ **UE5 系统要求**: - Windows 10/11 64-bit - 16GB RAM (建议 32GB+) - 支持 DirectX 12 的显卡 - 100GB SSD 存储 ## 下一步 详细开发文档: `docs/ue5_development_plan.md`