Skip to content

Commit

Permalink
Merge pull request #273 from jcarpent/topic/hfield
Browse files Browse the repository at this point in the history
Fix computation of aabb_center
  • Loading branch information
jcarpent authored Mar 16, 2022
2 parents 5a96f2c + c23ca3a commit 4512387
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmake
Submodule cmake updated 1 files
+23 −19 cxx-standard.cmake
7 changes: 4 additions & 3 deletions include/hpp/fcl/hfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,13 @@ class HPP_FCL_DLLAPI HeightField
/// @brief Compute the AABB for the HeightField, used for broad-phase collision
void computeLocalAABB()
{
Vec3f A(x_grid[0],y_grid[0],min_height);
Vec3f B(x_grid[x_grid.size()-1],y_grid[y_grid.size()-1],max_height);
AABB aabb_(A,B);
const Vec3f A(x_grid[0],y_grid[0],min_height);
const Vec3f B(x_grid[x_grid.size()-1],y_grid[y_grid.size()-1],max_height);
const AABB aabb_(A,B);

aabb_radius = (A-B).norm()/2.;
aabb_local = aabb_;
aabb_center = aabb_.center();
}

/// \brief Comparison operators
Expand Down

0 comments on commit 4512387

Please sign in to comment.