Add debug drawing contact offset for selected collider

#1728
This commit is contained in:
Wojtek Figat
2023-11-07 09:56:33 +01:00
parent 6648481d12
commit f6645e5600
3 changed files with 27 additions and 7 deletions

View File

@@ -81,6 +81,13 @@ void BoxCollider::OnDebugDrawSelected()
const Color color = Color::GreenYellow;
DEBUG_DRAW_WIRE_BOX(_bounds, color * 0.3f, 0, false);
if (_contactOffset > 0)
{
OrientedBoundingBox contactBounds = _bounds;
contactBounds.Extents += Vector3(_contactOffset) / contactBounds.Transformation.Scale;
DEBUG_DRAW_WIRE_BOX(contactBounds, Color::Blue.AlphaMultiplied(0.2f), 0, false);
}
Vector3 corners[8];
_bounds.GetCorners(corners);
const float margin = 1.0f;