0

I wrote a simple example of continuous collision using vs2019, but I can't always compile. Error information:

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, 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, 0);

    fcl::ContinuousCollisionRequestf request;
    fcl::ContinuousCollisionResultf result;
    std::cout << fcl::continuousCollide(o1, t1_final, o2, t2_final, request, result);

    delete o1;
    delete o2;

'fcl::InterpMotion': cannot instantiate abstract class

风何之
  • 43
  • 3

1 Answers1

0

in 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 I had to change double to S.

template <typename S>
bool InterpMotion<S>::integrate(double dt) const

template <typename S>
bool InterpMotion<S>::integrate(S dt) const
风何之
  • 43
  • 3