Fixes 08 (#98)

- fix hull builder face and edge leak
- fix #95
- samples app will no longer crash if data folder is not found
This commit is contained in:
Erin Catto 2026-07-22 15:55:02 -07:00 • committed by GitHub
commit c52908c9a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 307 additions and 153 deletions

View file

@ -499,9 +499,10 @@ public:
AddGroundBox( 20.0f );
// Mesh
{
m_meshData = CreateMeshData( "data/meshes/conveyor.obj", 1.0f, false, true, true, true );
m_meshData = CreateMeshData( "data/meshes/conveyor.obj", 1.0f, false, true, true, true );
if ( m_meshData != nullptr )
{
int triangleCount = m_meshData->triangleCount;
uint8_t* materialIndices = (uint8_t*)( (intptr_t)m_meshData + m_meshData->materialOffset );
@ -620,7 +621,7 @@ public:
~ConveyorMesh() override
{
b3DestroyMesh( m_meshData );
DestroyMeshData( m_meshData );
b3DestroyHull( m_cylinderHull );
}
@ -628,6 +629,11 @@ public:
{
Sample::Render();
if ( m_meshData == nullptr )
{
return;
}
int triangleCount = m_meshData->triangleCount;
const b3MeshTriangle* triangles = b3GetMeshTriangles( m_meshData );
const b3Vec3* vertices = b3GetMeshVertices( m_meshData );