Verified Commit e25f2850 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: use pointers instead const ref

This is mandatory for allowing copy
parent a4d21906
......@@ -281,22 +281,22 @@ PINOCCHIO_COMPILER_DIAGNOSTIC_POP
ComputeCollision(const GeometryObject & o1, const GeometryObject & o2)
: Base(o1.geometry.get(),o2.geometry.get())
, o1(o1)
, o2(o2)
, o1(&o1)
, o2(&o2)
{}
virtual ~ComputeCollision() {};
protected:
const GeometryObject & o1;
const GeometryObject & o2;
const GeometryObject * o1;
const GeometryObject * o2;
virtual std::size_t run(const fcl::Transform3f& tf1, const fcl::Transform3f& tf2,
const fcl::CollisionRequest& request, fcl::CollisionResult& result) const
{
typedef ::hpp::fcl::CollisionGeometry const * Pointer;
const_cast<Pointer&>(Base::o1) = o1.geometry.get();
const_cast<Pointer&>(Base::o2) = o2.geometry.get();
const_cast<Pointer&>(Base::o1) = o1->geometry.get();
const_cast<Pointer&>(Base::o2) = o2->geometry.get();
return Base::run(tf1, tf2, request, result);
}
};
......@@ -308,22 +308,22 @@ PINOCCHIO_COMPILER_DIAGNOSTIC_POP
ComputeDistance(const GeometryObject & o1, const GeometryObject & o2)
: Base(o1.geometry.get(),o2.geometry.get())
, o1(o1)
, o2(o2)
, o1(&o1)
, o2(&o2)
{}
virtual ~ComputeDistance() {};
protected:
const GeometryObject & o1;
const GeometryObject & o2;
const GeometryObject * o1;
const GeometryObject * o2;
virtual hpp::fcl::FCL_REAL run(const fcl::Transform3f& tf1, const fcl::Transform3f& tf2,
const fcl::DistanceRequest& request, fcl::DistanceResult& result) const
{
typedef ::hpp::fcl::CollisionGeometry const * Pointer;
const_cast<Pointer&>(Base::o1) = o1.geometry.get();
const_cast<Pointer&>(Base::o2) = o2.geometry.get();
const_cast<Pointer&>(Base::o1) = o1->geometry.get();
const_cast<Pointer&>(Base::o2) = o2->geometry.get();
return Base::run(tf1, tf2, request, result);
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment