feat: Jolt 物理系统——刚体/碰撞体/物理调试图元 + 引擎时间单源

- PhysicsWorld:Jolt 集成,Dynamic/Kinematic/Static 刚体,姿态写回
  Transform(Unity FixedUpdate 语义,吃 scaled dt,暂停自动冻结)
- 碰撞体:Box(默认/手动 halfExtents)+ Mesh 碰撞体(Static→精确
  MeshShape / Dynamic·Kinematic→ConvexHull,数据源 = Mesh ctor 缓存
  的 CPU 位置副本,退化三角剔除,失败回退 Box 并告警)
- PhysicsDebugPass:物理调试图元每帧上传绘制(debug_line shader)
- Time:引擎时间单源(BeginFrame 落定 FrameTime,scaled/unscaled 分离)
- JoltPhysics 以 submodule 接入(官方 url)
This commit is contained in:
2026-10-02 20:08:54 +08:00
parent bfbb18f1a4
commit 1c4b6f37ff
21 changed files with 1589 additions and 31 deletions
+8
View File
@@ -35,6 +35,14 @@ namespace Engine
return;
}
// CPU 位置副本:物理 MeshShape/ConvexHull 数据源(GPU 上传后
// 完整 Vertex 不再保留,见 Mesh.h)
m_CpuPositions.reserve(vertices.size());
for (const auto& v : vertices) {
m_CpuPositions.push_back(v.position);
}
m_CpuIndices = lods[0];
u64 vbSize = sizeof(Vertex) * vertices.size();
m_VertexBuffer = CreateScope<Buffer>(
device, allocator, vbSize,