Add drawing RigidBody center of mass and attached colliders
#2325 #3247
This commit is contained in:
@@ -111,18 +111,11 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void BoxCollider::OnDebugDrawSelected()
|
||||
void BoxCollider::OnDebugDrawSelf()
|
||||
{
|
||||
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 = Math::Min(1.0f, _bounds.GetSize().MinValue() * 0.01f);
|
||||
@@ -146,8 +139,19 @@ void BoxCollider::OnDebugDrawSelected()
|
||||
{
|
||||
DEBUG_DRAW_WIRE_BOX(_bounds, wiresColor, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
void BoxCollider::OnDebugDrawSelected()
|
||||
{
|
||||
OnDebugDrawSelf();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
// Base
|
||||
Collider::OnDebugDrawSelected();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user