修复physics物理数据计算不正确的问题,同时为物理添加map索引
This commit is contained in:
@@ -183,6 +183,11 @@ namespace Engine {
|
||||
|
||||
std::unordered_map<u32, BodyRecord> m_Bodies; // entity 位模式 → body
|
||||
|
||||
// BodyID 序号 → entity 位模式(O(1) 反查;ContactListener 回调用)
|
||||
// 与 m_Bodies 同生共死:CreateBody 同插,RemoveBody/孤儿清理同 erase。
|
||||
// 主线程在 SyncScene 写、Step 内 Update 阶段不写 → 回调线程只读,无需加锁
|
||||
std::unordered_map<u32, u32> m_BodyToEntity;
|
||||
|
||||
// ---- 碰撞事件收集(多线程回调入队,主线程消费)----
|
||||
class ContactListenerImpl; // cpp 定义(JPH::ContactListener 派生)
|
||||
Scope<ContactListenerImpl> m_ContactListener;
|
||||
|
||||
Reference in New Issue
Block a user