MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnDebugDrawSelected

Method OnDebugDrawSelected

Source/Engine/Physics/Actors/RigidBody.cpp:346–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344#include "Engine/Debug/DebugDraw.h"
345
346void RigidBody::OnDebugDrawSelected()
347{
348 // Draw center of mass
349 if (!_centerOfMassOffset.IsZero())
350 {
351 DEBUG_DRAW_WIRE_SPHERE(BoundingSphere(GetPosition() + (GetOrientation() * (GetCenterOfMass() - GetCenterOfMassOffset())), 5.0f), Color::Red, 0, false);
352 }
353 DEBUG_DRAW_WIRE_SPHERE(BoundingSphere(GetPosition() + (GetOrientation() * GetCenterOfMass()), 2.5f), Color::Aqua, 0, false);
354
355 // Draw all attached colliders
356 for (Actor* child : Children)
357 {
358 const auto collider = Cast<Collider>(child);
359 if (collider && collider->GetAttachedRigidBody() == this)
360 collider->OnDebugDrawSelf();
361 }
362
363 Actor::OnDebugDrawSelected();
364}
365
366#endif
367

Callers

nothing calls this directly

Calls 8

GetOrientationFunction · 0.85
GetCenterOfMassOffsetFunction · 0.85
OnDebugDrawSelectedFunction · 0.85
BoundingSphereClass · 0.50
GetPositionFunction · 0.50
IsZeroMethod · 0.45
GetAttachedRigidBodyMethod · 0.45
OnDebugDrawSelfMethod · 0.45

Tested by

no test coverage detected