Skip to content

Commit

Permalink
optimize collision checking in ode (#2945)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
  • Loading branch information
iche033 authored Mar 8, 2021
1 parent d94e2e0 commit db40ad5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deps/opende/src/collision_space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,13 @@ void dxHashSpace::collide (void *_data, dNearCallback *callback)
if (!GEOM_ENABLED(geom)){
continue;
}

// skip geoms that have zero or negative/invalid aabb
if (geom->aabb[1] - geom->aabb[0] <= 0.0 &&
geom->aabb[3] - geom->aabb[2] <= 0.0 &&
geom->aabb[5] - geom->aabb[4] <= 0.0)
continue;

dxAABB *aabb3 = (dxAABB*) ALLOCA (sizeof(dxAABB));
aabb3->geom = geom;
// compute level, but prevent cells from getting too small
Expand Down

0 comments on commit db40ad5

Please sign in to comment.