Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix computation of aabb_center #273

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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