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:
2026-10-03 19:01:57 +08:00
parent 29c413579d
commit 134812dae3
3 changed files with 27 additions and 0 deletions
+8
View File
@@ -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();
}