LDKDebugDraw
typedef struct LDKDebugDraw{
LDKRenderer *renderer;
LDKRendererViewId view_id;
float thickness;
u32 color;
bool depth_test;
}LDKDebugDraw;
Transient 3D debug geometry, available to editor and game builds. All distances, including thickness, are in world units. Colors: 0xRRGGBBAA. No global state or ownership: the context can be kept or copied by callers. Call on the render thread before render_frame, and resubmit every frame. Helpers return false on invalid arguments or submission failure. A failed helper may have submitted part of its shape. Tessellation: 3..4096 segments.
typedef struct LDKDebugDraw{
LDKRenderer *renderer;
LDKRendererViewId view_id;
float thickness;
u32 color;
bool depth_test;
}LDKDebugDraw;
Create a debug drawing context for a renderer view.
LDK_API LDKDebugDraw ldk_debug_draw_make(
LDKRenderer *renderer,
LDKRendererViewId view_id
);
LDKRenderer *rendererLDKRendererViewId view_idThe requested value.
Draw a line between two 3D positions.
LDK_API bool ldk_debug_draw_line(
const LDKDebugDraw *draw,
Vec3 start,
Vec3 end
);
const LDKDebugDraw *drawVec3 startVec3 endTrue if the operation succeeds; false otherwise.
Draw a directional arrow between two 3D positions.
LDK_API bool ldk_debug_draw_arrow(
const LDKDebugDraw *draw,
Vec3 start,
Vec3 end
);
const LDKDebugDraw *drawVec3 startVec3 endTrue if the operation succeeds; false otherwise.
Draw coordinate axes using a world transform.
LDK_API bool ldk_debug_draw_axes(
const LDKDebugDraw *draw,
Mat4 world,
float length
);
const LDKDebugDraw *drawMat4 worldfloat lengthTrue if the operation succeeds; false otherwise.
Draw an axis-aligned 3D bounding box.
LDK_API bool ldk_debug_draw_box(
const LDKDebugDraw *draw,
Vec3 minimum,
Vec3 maximum
);
const LDKDebugDraw *drawVec3 minimumVec3 maximumTrue if the operation succeeds; false otherwise.
Draw a circle in 3D space.
LDK_API bool ldk_debug_draw_circle(
const LDKDebugDraw *draw,
Vec3 center,
Vec3 normal,
float radius,
u32 segments
);
const LDKDebugDraw *drawVec3 centerVec3 normalfloat radiusu32 segmentsTrue if the operation succeeds; false otherwise.
Draw a wireframe sphere in 3D space.
LDK_API bool ldk_debug_draw_sphere(
const LDKDebugDraw *draw,
Vec3 center,
float radius,
u32 segments
);
const LDKDebugDraw *drawVec3 centerfloat radiusu32 segmentsTrue if the operation succeeds; false otherwise.
Draw a wireframe cone in 3D space.
LDK_API bool ldk_debug_draw_cone(
const LDKDebugDraw *draw,
Vec3 apex,
Vec3 direction,
float height,
float radius,
u32 segments
);
const LDKDebugDraw *drawVec3 apexVec3 directionfloat heightfloat radiusu32 segmentsTrue if the operation succeeds; false otherwise.
Draw a camera or projection frustum.
LDK_API bool ldk_debug_draw_frustum(
const LDKDebugDraw *draw,
Mat4 inverse_view_projection
);
const LDKDebugDraw *drawMat4 inverse_view_projectionTrue if the operation succeeds; false otherwise.