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

Method DrawCapsule

Source/Engine/Debug/DebugDraw.cpp:1832–1849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1830}
1831
1832void DebugDraw::DrawCapsule(const Vector3& position, const Quaternion& orientation, float radius, float length, const Color& color, float duration, bool depthTest)
1833{
1834 // Check if has no length (just sphere)
1835 if (length < ZeroTolerance)
1836 {
1837 DrawSphere(BoundingSphere(position, radius), color, duration, depthTest);
1838 }
1839 else
1840 {
1841 const Float3 dir = orientation * Float3::Forward;
1842 radius = Math::Max(radius, 0.05f);
1843 length = Math::Max(length, 0.05f);
1844 const float halfLength = length / 2.0f;
1845 DrawSphere(BoundingSphere(position + dir * halfLength, radius), color, duration, depthTest);
1846 DrawSphere(BoundingSphere(position - dir * halfLength, radius), color, duration, depthTest);
1847 DrawCylinder(position, orientation * Quaternion::Euler(90.0f, 0, 0), radius, length, color, duration, depthTest);
1848 }
1849}
1850
1851void DebugDraw::DrawWireTube(const Vector3& position, const Quaternion& orientation, float radius, float length, const Color& color, float duration, bool depthTest)
1852{

Callers

nothing calls this directly

Calls 3

DrawCylinderFunction · 0.85
BoundingSphereClass · 0.50
MaxFunction · 0.50

Tested by

no test coverage detected