box3d/samples/gfx/debug_adapter.h

45 lines
1.3 KiB
C
Raw Normal View History

// SPDX-FileCopyrightText: 2026 Erin Catto
// SPDX-License-Identifier: MIT
#pragma once
#include "box3d/types.h"
#include "gfx/utility.h"
#ifdef __cplusplus
extern "C"
{
#endif
void InitAdapter( void );
// Unconditionally flush the debug-shape pool: release the GPU mesh references
// held by live hull/mesh/heightfield shapes and rebuild the free list. Call
// before b3DestroyWorld (or on scene switch). Defensive even when
// destroyDebugShape already fired for every shape. After this,
// GetDebugShapeCount() == 0 and the next world allocates from the pool bottom.
void ResetAdapterPool( void );
void AttachToWorldDef( b3WorldDef* def );
void MakeDebugDraw( b3DebugDraw* out );
b3DebugDraw* GetGuiDraw( void );
void ApplyGuiFlags( b3DebugDraw* out );
int GetDebugShapeCount( void );
// Tag a Box3D shape so the renderer draws it with the procedural ground grid.
void SetGroundShape( b3ShapeId shapeId );
void SetShapeMaterial( b3ShapeId shapeId, Vec4 color, float metallic, float roughness );
void SetTransparentDynamic( bool enabled );
bool GetTransparentDynamic( void );
void SetHoveredBody( b3BodyId bodyId );
b3BodyId GetHoveredBody( void );
void SetSelectedBody( b3BodyId bodyId );
void ClearSelection( void );
b3BodyId GetSelectedBody( void );
bool IsBodySelected( b3BodyId bodyId );
#ifdef __cplusplus
} // extern "C"
#endif