Add drawing RigidBody center of mass and attached colliders

#2325 #3247
This commit is contained in:
Wojtek Figat
2025-10-08 22:16:16 +02:00
parent 73976f3ed9
commit e2fc8a6283
11 changed files with 75 additions and 11 deletions

View File

@@ -52,6 +52,17 @@ void CapsuleCollider::DrawPhysicsDebug(RenderView& view)
DEBUG_DRAW_WIRE_CAPSULE(_transform.LocalToWorld(_center), rotation, radius, height, Color::GreenYellow * 0.8f, 0, true);
}
void CapsuleCollider::OnDebugDrawSelf()
{
Quaternion rotation;
Quaternion::Multiply(_transform.Orientation, Quaternion::Euler(0, 90, 0), rotation);
const float minSize = 0.001f;
const float radius = Math::Max(Math::Abs(_radius) * _cachedScale, minSize);
const float height = Math::Max(Math::Abs(_height) * _cachedScale, minSize);
const Vector3 position = _transform.LocalToWorld(_center);
DEBUG_DRAW_WIRE_CAPSULE(position, rotation, radius, height, Color::GreenYellow, 0, false);
}
void CapsuleCollider::OnDebugDrawSelected()
{
Quaternion rotation;