Skip to content

Commit 2e627e6

Browse files
committed
core: fix operator= for ShapeBase
1 parent 793b5ec commit 2e627e6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

include/hpp/fcl/shape/geometric_shapes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class HPP_FCL_DLLAPI ShapeBase : public CollisionGeometry {
5555
/// \brief Copy constructor
5656
ShapeBase(const ShapeBase& other) : CollisionGeometry(other) {}
5757

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

6060
virtual ~ShapeBase(){};
6161

test/bvh_models.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <hpp/fcl/BVH/BVH_utility.h>
4747
#include <hpp/fcl/math/transform.h>
4848
#include <hpp/fcl/shape/geometric_shapes.h>
49+
#include <hpp/fcl/shape/geometric_shape_to_BVH_model.h>
4950
#include <hpp/fcl/mesh_loader/assimp.h>
5051
#include <hpp/fcl/mesh_loader/loader.h>
5152
#include "utility.h"
@@ -370,3 +371,14 @@ BOOST_AUTO_TEST_CASE(load_illformated_mesh) {
370371
MeshLoader loader;
371372
BOOST_CHECK_NO_THROW(loader.load(filename));
372373
}
374+
375+
BOOST_AUTO_TEST_CASE(test_convex) {
376+
Box* box_ptr = new hpp::fcl::Box(1, 1, 1);
377+
CollisionGeometryPtr_t b1(box_ptr);
378+
BVHModel<OBBRSS> box_bvh_model = BVHModel<OBBRSS>();
379+
generateBVHModel(box_bvh_model, *box_ptr, Transform3f());
380+
box_bvh_model.buildConvexRepresentation(false);
381+
382+
std::shared_ptr<ConvexBase> convex_copy(box_bvh_model.convex->clone());
383+
BOOST_CHECK(*convex_copy.get() == *box_bvh_model.convex.get());
384+
}

0 commit comments

Comments
 (0)