From 4a962b6a521ae2955cdd8ec9eb98261eae5d5a46 Mon Sep 17 00:00:00 2001 From: Irlan <-> Date: Wed, 9 May 2018 05:41:17 -0300 Subject: [PATCH] verify hull face is a polygon --- src/bounce/collision/shapes/hull.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bounce/collision/shapes/hull.cpp b/src/bounce/collision/shapes/hull.cpp index 2f7242b..873604a 100644 --- a/src/bounce/collision/shapes/hull.cpp +++ b/src/bounce/collision/shapes/hull.cpp @@ -40,14 +40,17 @@ void b3Hull::Validate() const void b3Hull::Validate(const b3Face* face) const { + u32 n = 0; const b3HalfEdge* begin = GetEdge(face->edge); const b3HalfEdge* edge = begin; do { B3_ASSERT(GetFace(edge->face) == face); + ++n; edge = edges + edge->next; } while (edge != begin); + B3_ASSERT(n >= 3); Validate(edges + face->edge); }