This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/physic/cm_debug.c

24 lines
811 B
C

//=======================================================================
// Copyright XashXT Group 2007 ©
// cm_debug.c - draw collision hulls outlines
//=======================================================================
#include "cm_local.h"
void DebugShowGeometryCollision( const NewtonBody* body, int vertexCount, const float* faceVertec, int id )
{
// callback to render.dll
if( ph.debug_line ) ph.debug_line( 0, vertexCount, faceVertec );
}
void DebugShowBodyCollision( const NewtonBody* body )
{
NewtonBodyForEachPolygonDo(body, DebugShowGeometryCollision );
}
void DebugShowCollision( cmdraw_t callback )
{
// called from render.dll
ph.debug_line = callback; // member draw function
NewtonWorldForEachBodyDo( gWorld, DebugShowBodyCollision );
}