From f3946716d8b4806b4dcf22cb6d35f3bccd06750f Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Wed, 28 Nov 2012 21:47:58 +0000 Subject: [PATCH] ephysics: don't try to set bad body geometry when adding boundaries If render geometry is not set yet, it will try to set a bad geometry for the boundary boxes. In this case, let these bodies with default size and only resize them when render geometry is set. SVN revision: 79791 --- legacy/ephysics/src/lib/ephysics_body.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp index 25f86ab35c..1a92b2e293 100644 --- a/legacy/ephysics/src/lib/ephysics_body.cpp +++ b/legacy/ephysics/src/lib/ephysics_body.cpp @@ -3015,7 +3015,11 @@ _ephysics_body_boundary_add(EPhysics_World *world, EPhysics_World_Boundary bound body->boundary = EINA_TRUE; ephysics_body_mass_set(body, 0); ephysics_world_boundary_set(world, boundary, body); - ephysics_body_geometry_set(body, x, y, z, w, h, d); + + if ((w <= 0) || (h <= 0) || (d <= 0)) + INF("Boundary added with default geometry. Render geometry not set yet"); + else + ephysics_body_geometry_set(body, x, y, z, w, h, d); return body; }