Skip to content

Commit

Permalink
core: fix operator= for ShapeBase
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarpent committed Jul 5, 2022
1 parent 793b5ec commit 2e627e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/hpp/fcl/shape/geometric_shapes.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HPP_FCL_DLLAPI ShapeBase : public CollisionGeometry {
/// \brief Copy constructor
ShapeBase(const ShapeBase& other) : CollisionGeometry(other) {}

ShapeBase& operator=(const ShapeBase& /*other*/) { return *this; }
ShapeBase& operator=(const ShapeBase& other) = default;

virtual ~ShapeBase(){};

Expand Down
12 changes: 12 additions & 0 deletions test/bvh_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <hpp/fcl/BVH/BVH_utility.h>
#include <hpp/fcl/math/transform.h>
#include <hpp/fcl/shape/geometric_shapes.h>
#include <hpp/fcl/shape/geometric_shape_to_BVH_model.h>
#include <hpp/fcl/mesh_loader/assimp.h>
#include <hpp/fcl/mesh_loader/loader.h>
#include "utility.h"
Expand Down Expand Up @@ -370,3 +371,14 @@ BOOST_AUTO_TEST_CASE(load_illformated_mesh) {
MeshLoader loader;
BOOST_CHECK_NO_THROW(loader.load(filename));
}

BOOST_AUTO_TEST_CASE(test_convex) {
Box* box_ptr = new hpp::fcl::Box(1, 1, 1);
CollisionGeometryPtr_t b1(box_ptr);
BVHModel<OBBRSS> box_bvh_model = BVHModel<OBBRSS>();
generateBVHModel(box_bvh_model, *box_ptr, Transform3f());
box_bvh_model.buildConvexRepresentation(false);

std::shared_ptr<ConvexBase> convex_copy(box_bvh_model.convex->clone());
BOOST_CHECK(*convex_copy.get() == *box_bvh_model.convex.get());
}

0 comments on commit 2e627e6

Please sign in to comment.