问题描述
我用vs2019写了一个简单的连续碰撞的例子,但是总是编译不了。 错误信息:
C2259 'fcl::InterpMotion<S>': cannot instantiate abstract class
C2259 'fcl::ScrewMotion<S>': cannot instantiate abstract class
auto g1 = std::make_shared<fcl::Boxf>(1,2,3);
auto t1 = fcl::Transform3f::Identity();
auto o1 = new fcl::CollisionObjectf(g1,t1);
auto t1_final = fcl::Transform3f::Identity();
t1_final.translation() = fcl::Vector3f(1,0);
auto g2 = std::make_shared<fcl::Conef>(1,3);
auto t2 = fcl::Transform3f::Identity();
auto o2 = new fcl::CollisionObjectf(g2,t2);
auto t2_final = fcl::Transform3f::Identity();
t2_final.translation() = fcl::Vector3f(-1,0);
fcl::ContinuousCollisionRequestf request;
fcl::ContinuousCollisionResultf result;
std::cout << fcl::continuousCollide(o1,t1_final,o2,t2_final,request,result);
delete o1;
delete o2;
解决方法
在
fcl/math/motion/interp_motion.h
fcl/math/motion/interp_motion-inl.h
fcl/math/motion/screw_motion.h
fcl/math/motion/screw_motion-inl.h
我不得不将 double
更改为 S
。
template <typename S>
bool InterpMotion<S>::integrate(double dt) const
template <typename S>
bool InterpMotion<S>::integrate(S dt) const