feat(physics): debug-draw character controller capsule
CharacterVirtual is not a registered body, so PhysicsSystem::DrawBodies never renders it (Jolt provides no CharacterVirtual::DebugDraw either). Add CharacterController::DebugDraw (shape wireframe at foot-origin + shapeOffset, green) and drive it from CollectDebugData under the colliders bit.
This commit is contained in:
@@ -326,6 +326,14 @@ namespace Engine {
|
||||
}
|
||||
}
|
||||
|
||||
// 4) 角色控制器:CharacterVirtual 非 body,DrawBodies 画不到,
|
||||
// 手动画胶囊线框(绿 = 与普通 collider 区分)
|
||||
if ((m_DebugBits & kPhyDbgColliders) != 0) {
|
||||
for (auto &[bits, entry] : m_Characters) {
|
||||
entry.cc->DebugDraw(*m_DebugDraw);
|
||||
}
|
||||
}
|
||||
|
||||
// 释放上一帧缓存不再引用的通用几何 batch(DebugRenderer 内部池)
|
||||
m_DebugDraw->NextFrame();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user