Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with creating instances of type InterpMotion<float> #476

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
5 changes: 4 additions & 1 deletion include/fcl/math/motion/interp_motion-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ namespace fcl
{

//==============================================================================
extern template
class FCL_EXPORT InterpMotion<float>;

extern template
class FCL_EXPORT InterpMotion<double>;

Expand Down Expand Up @@ -127,7 +130,7 @@ InterpMotion<S>::InterpMotion(

//==============================================================================
template <typename S>
bool InterpMotion<S>::integrate(double dt) const
bool InterpMotion<S>::integrate(S dt) const
{
if(dt > 1) dt = 1;

Expand Down
2 changes: 1 addition & 1 deletion include/fcl/math/motion/interp_motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class FCL_EXPORT InterpMotion : public MotionBase<S>

/// @brief Integrate the motion from 0 to dt
/// We compute the current transformation from zero point instead of from last integrate time, for precision.
bool integrate(double dt) const;
bool integrate(S dt) const;

/// @brief Compute the motion bound for a bounding volume along a given direction n, which is defined in the visitor
S computeMotionBound(const BVMotionBoundVisitor<S>& mb_visitor) const;
Expand Down
5 changes: 4 additions & 1 deletion include/fcl/math/motion/screw_motion-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ namespace fcl
{

//==============================================================================
extern template
class FCL_EXPORT ScrewMotion<float>;

extern template
class FCL_EXPORT ScrewMotion<double>;

Expand Down Expand Up @@ -92,7 +95,7 @@ ScrewMotion<S>::ScrewMotion(

//==============================================================================
template <typename S>
bool ScrewMotion<S>::integrate(double dt) const
bool ScrewMotion<S>::integrate(S dt) const
{
if(dt > 1) dt = 1;

Expand Down
2 changes: 1 addition & 1 deletion include/fcl/math/motion/screw_motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class FCL_EXPORT ScrewMotion : public MotionBase<S>

/// @brief Integrate the motion from 0 to dt
/// We compute the current transformation from zero point instead of from last integrate time, for precision.
bool integrate(double dt) const;
bool integrate(S dt) const;

/// @brief Compute the motion bound for a bounding volume along a given direction n, which is defined in the visitor
S computeMotionBound(const BVMotionBoundVisitor<S>& mb_visitor) const;
Expand Down
18 changes: 18 additions & 0 deletions include/fcl/narrowphase/collision-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ namespace fcl
{

//==============================================================================
extern template
FCL_EXPORT
std::size_t collide(
const CollisionObject<float>* o1,
const CollisionObject<float>* o2,
const CollisionRequest<float>& request,
CollisionResult<float>& result);

extern template
FCL_EXPORT
std::size_t collide(
Expand All @@ -57,6 +65,16 @@ std::size_t collide(
CollisionResult<double>& result);

//==============================================================================
extern template
FCL_EXPORT
std::size_t collide(
const CollisionGeometry<float>* o1,
const Transform3<float>& tf1,
const CollisionGeometry<float>* o2,
const Transform3<float>& tf2,
const CollisionRequest<float>& request,
CollisionResult<float>& result);

extern template
FCL_EXPORT
std::size_t collide(
Expand Down
3 changes: 3 additions & 0 deletions include/fcl/narrowphase/collision_object-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ namespace fcl
{

//==============================================================================
extern template
class FCL_EXPORT CollisionObject<float>;

extern template
class FCL_EXPORT CollisionObject<double>;

Expand Down
37 changes: 37 additions & 0 deletions include/fcl/narrowphase/continuous_collision-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ namespace fcl
{

//==============================================================================
extern template
float continuousCollide(
const CollisionGeometry<float>* o1,
const MotionBase<float>* motion1,
const CollisionGeometry<float>* o2,
const MotionBase<float>* motion2,
const ContinuousCollisionRequest<float>& request,
ContinuousCollisionResult<float>& result);

extern template
double continuousCollide(
const CollisionGeometry<double>* o1,
Expand All @@ -65,6 +74,17 @@ double continuousCollide(
ContinuousCollisionResult<double>& result);

//==============================================================================
extern template
float continuousCollide(
const CollisionGeometry<float>* o1,
const Transform3<float>& tf1_beg,
const Transform3<float>& tf1_end,
const CollisionGeometry<float>* o2,
const Transform3<float>& tf2_beg,
const Transform3<float>& tf2_end,
const ContinuousCollisionRequest<float>& request,
ContinuousCollisionResult<float>& result);

extern template
double continuousCollide(
const CollisionGeometry<double>* o1,
Expand All @@ -77,6 +97,15 @@ double continuousCollide(
ContinuousCollisionResult<double>& result);

//==============================================================================
extern template
float continuousCollide(
const CollisionObject<float>* o1,
const Transform3<float>& tf1_end,
const CollisionObject<float>* o2,
const Transform3<float>& tf2_end,
const ContinuousCollisionRequest<float>& request,
ContinuousCollisionResult<float>& result);

extern template
double continuousCollide(
const CollisionObject<double>* o1,
Expand All @@ -87,13 +116,21 @@ double continuousCollide(
ContinuousCollisionResult<double>& result);

//==============================================================================
extern template
float collide(
const ContinuousCollisionObject<float>* o1,
const ContinuousCollisionObject<float>* o2,
const ContinuousCollisionRequest<float>& request,
ContinuousCollisionResult<float>& result);

extern template
double collide(
const ContinuousCollisionObject<double>* o1,
const ContinuousCollisionObject<double>* o2,
const ContinuousCollisionRequest<double>& request,
ContinuousCollisionResult<double>& result);


//==============================================================================
template<typename GJKSolver>
detail::ConservativeAdvancementFunctionMatrix<GJKSolver>&
Expand Down
3 changes: 3 additions & 0 deletions src/math/motion/interp_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
namespace fcl
{

template
class InterpMotion<float>;

template
class InterpMotion<double>;

Expand Down
3 changes: 3 additions & 0 deletions src/math/motion/screw_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
namespace fcl
{

template
class ScrewMotion<float>;

template
class ScrewMotion<double>;

Expand Down
16 changes: 16 additions & 0 deletions src/narrowphase/collision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ namespace fcl
{

//==============================================================================
template
std::size_t collide(
const CollisionObject<float>* o1,
const CollisionObject<float>* o2,
const CollisionRequest<float>& request,
CollisionResult<float>& result);

template
std::size_t collide(
const CollisionObject<double>* o1,
Expand All @@ -49,6 +56,15 @@ std::size_t collide(
CollisionResult<double>& result);

//==============================================================================
template
std::size_t collide(
const CollisionGeometry<float>* o1,
const Transform3<float>& tf1,
const CollisionGeometry<float>* o2,
const Transform3<float>& tf2,
const CollisionRequest<float>& request,
CollisionResult<float>& result);

template
std::size_t collide(
const CollisionGeometry<double>* o1,
Expand Down
3 changes: 3 additions & 0 deletions src/narrowphase/collision_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
namespace fcl
{

template
class CollisionObject<float>;

template
class CollisionObject<double>;

Expand Down
36 changes: 36 additions & 0 deletions src/narrowphase/continuous_collision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ namespace fcl
{

//==============================================================================
template
float continuousCollide(
const CollisionGeometry<float>* o1,
const MotionBase<float>* motion1,
const CollisionGeometry<float>* o2,
const MotionBase<float>* motion2,
const ContinuousCollisionRequest<float>& request,
ContinuousCollisionResult<float>& result);

template
double continuousCollide(
const CollisionGeometry<double>* o1,
Expand All @@ -51,6 +60,17 @@ double continuousCollide(
ContinuousCollisionResult<double>& result);

//==============================================================================
template
float continuousCollide(
const CollisionGeometry<float>* o1,
const Transform3<float>& tf1_beg,
const Transform3<float>& tf1_end,
const CollisionGeometry<float>* o2,
const Transform3<float>& tf2_beg,
const Transform3<float>& tf2_end,
const ContinuousCollisionRequest<float>& request,
ContinuousCollisionResult<float>& result);

template
double continuousCollide(
const CollisionGeometry<double>* o1,
Expand All @@ -63,6 +83,15 @@ double continuousCollide(
ContinuousCollisionResult<double>& result);

//==============================================================================
template
float continuousCollide(
const CollisionObject<float>* o1,
const Transform3<float>& tf1_end,
const CollisionObject<float>* o2,
const Transform3<float>& tf2_end,
const ContinuousCollisionRequest<float>& request,
ContinuousCollisionResult<float>& result);

template
double continuousCollide(
const CollisionObject<double>* o1,
Expand All @@ -73,6 +102,13 @@ double continuousCollide(
ContinuousCollisionResult<double>& result);

//==============================================================================
template
float collide(
const ContinuousCollisionObject<float>* o1,
const ContinuousCollisionObject<float>* o2,
const ContinuousCollisionRequest<float>& request,
ContinuousCollisionResult<float>& result);

template
double collide(
const ContinuousCollisionObject<double>* o1,
Expand Down
3 changes: 3 additions & 0 deletions src/narrowphase/continuous_collision_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
namespace fcl
{

template
class ContinuousCollisionObject<float>;

template
class ContinuousCollisionObject<double>;

Expand Down