Unverified Commit c62e6643 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Add Windows support and CI (#177)



* cmake: sync submodule

* ci: add Windows CI via Conda

* readme: update contributors

* ci: set events

* ci: set assimp_PREFIX

* ci: move conda-env to a dedicated directory

* cmake: use Findassimp from the official repository

* cmake: fix variable name

* all: fix KEYWORD position in function signatures

* cmake: add missing file in include list

* core: additional fixes

* core: fix missing HPP_FCL_DLLAPI

* core: remove useless HPP_FCL_DLLAPI

* core: forward declaration of template specialization

* core: add missing include

* core: fix guard

* core: template specialization

* cmake: fix link to Python for the wrapper

* ci: octomap is not well exported for Windows

* cmake: fix linkage

* core: add missing include

* cmake: fix assimp search

* test: fix math constant

* core: remove keyword for full templated classes

* cmake: sync submodule

* ci: remove useless line

* core: remove useless keyword

* core: add declaration of template specialization

* core: fix indents

* core: add missing keywords

* core: remove useless keywords

* Fix generation of Python doc.

* Fix compilation warnings.

Co-authored-by: Joseph Mirabel's avatarJoseph Mirabel <jmirabel@laas.fr>
parent 7dc6a3a9
name: fcl
channels:
- conda-forge
- nodefaults
dependencies:
- eigen
- assimp
- numpy
- boost
- eigenpy
- python
name: Build FCL for Windows via Conda
on: [push,pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [windows-latest-clang-cl]
include:
- name: windows-latest-clang-cl
os: windows-2019
compiler: clang-cl
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: |
git submodule update --init
- uses: goanpeca/setup-miniconda@v1
with:
activate-environment: fcl
environment-file: .github/workflows/conda/conda-env.yml
python-version: 3.7
- name: Install cmake and update conda
run: |
conda install cmake -c main
- name: Build FCL
shell: cmd /C CALL {0}
run: |
:: unset extra Boost envs
set Boost_ROOT=
set BOOST_ROOT_1_69_0=
set BOOST_ROOT_1_72_0=
set PATH=%PATH:C:\hostedtoolcache\windows\Boost\1.72.0;=%
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
:: start building
mkdir build
pushd build
set PKG_CONFIG_PATH=%CONDA_PREFIX%\Library\share\pkgconfig:%CONDA_PREFIX%\Library\share\pkgconfig
cmake ^
-G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_BUILD_TYPE=Release ^
-DHPP_FCL_SITELIB_ROOT=%CONDA_PREFIX% ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DBUILD_PYTHON_INTERFACE=ON ^
..
cmake --build . --config Release --target install
set PATH=%PATH%;%CONDA_PREFIX%\Library\lib;%CONDA_PREFIX%\Lib\site-packages\hppfcl
ctest --output-on-failure -C Release -V
...@@ -138,6 +138,7 @@ SET(${PROJECT_NAME}_HEADERS ...@@ -138,6 +138,7 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/shape/details/convex.hxx include/hpp/fcl/shape/details/convex.hxx
include/hpp/fcl/shape/geometric_shape_to_BVH_model.h include/hpp/fcl/shape/geometric_shape_to_BVH_model.h
include/hpp/fcl/shape/geometric_shapes.h include/hpp/fcl/shape/geometric_shapes.h
include/hpp/fcl/shape/geometric_shapes_utility.h
include/hpp/fcl/distance_func_matrix.h include/hpp/fcl/distance_func_matrix.h
include/hpp/fcl/collision.h include/hpp/fcl/collision.h
include/hpp/fcl/collision_func_matrix.h include/hpp/fcl/collision_func_matrix.h
......
...@@ -21,4 +21,4 @@ This project is now used in many robotics frameworks such as [Pinocchio](https:/ ...@@ -21,4 +21,4 @@ This project is now used in many robotics frameworks such as [Pinocchio](https:/
## Acknowledgments ## Acknowledgments
The development of **HPP-FCL** is actively supported by the [Gepetto team](http://projects.laas.fr/gepetto/) [@LAAS-CNRS](http://www.laas.fr) The development of **HPP-FCL** is actively supported by the [Gepetto team](http://projects.laas.fr/gepetto/) [@LAAS-CNRS](http://www.laas.fr) and the [Willow team](https://www.di.ens.fr/willow/) [@INRIA](http://www.inria.fr).
Subproject commit 9d9fda176e0330e0c29b9c91b5e417b3ece93848 Subproject commit 89bd42923644d96fbe99d7495d12021d1e885a83
# if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# Copyright 2020 CNRS INRIA set(ASSIMP_ARCHITECTURE "64")
# elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
# Author: Guilhem Saurel set(ASSIMP_ARCHITECTURE "32")
# endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
if(WIN32)
set(ASSIMP_ROOT_DIR CACHE PATH "ASSIMP root directory")
# Try to find assimp in standard prefixes and in ${assimp_PREFIX} # Find path of each library
# Once done this will define find_path(ASSIMP_INCLUDE_DIR
# assimp_FOUND - System has assimp NAMES
# assimp_INCLUDE_DIR - The assimp include directories assimp/anim.h
# assimp_LIBRARY - The libraries needed to use assimp HINTS
${ASSIMP_ROOT_DIR}/include
)
SET(assimp_INCLUDE_DIRS ${ASSIMP_INCLUDE_DIR})
FIND_PATH(assimp_INCLUDE_DIR if(MSVC12)
NAMES assimp/defs.h set(ASSIMP_MSVC_VERSION "vc120")
PATHS ${assimp_PREFIX} ${assimp_PREFIX}/include elseif(MSVC14)
) set(ASSIMP_MSVC_VERSION "vc140")
endif(MSVC12)
if(MSVC12 OR MSVC14)
find_path(ASSIMP_LIBRARY_DIR
NAMES
assimp-${ASSIMP_MSVC_VERSION}-mt.lib
HINTS
${ASSIMP_ROOT_DIR}/lib${ASSIMP_ARCHITECTURE}
)
find_library(ASSIMP_LIBRARY_RELEASE assimp-${ASSIMP_MSVC_VERSION}-mt.lib PATHS ${ASSIMP_LIBRARY_DIR})
find_library(ASSIMP_LIBRARY_DEBUG assimp-${ASSIMP_MSVC_VERSION}-mtd.lib PATHS ${ASSIMP_LIBRARY_DIR})
set(ASSIMP_LIBRARY
optimized ${ASSIMP_LIBRARY_RELEASE}
debug ${ASSIMP_LIBRARY_DEBUG}
)
set(ASSIMP_LIBRARIES ${ASSIMP_LIBRARY_RELEASE} ${ASSIMP_LIBRARY_DEBUG})
FUNCTION(ASSIMP_COPY_BINARIES TargetDirectory)
ADD_CUSTOM_TARGET(AssimpCopyBinaries
COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll ${TargetDirectory}/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll
COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-${ASSIMP_MSVC_VERSION}-mt.dll ${TargetDirectory}/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.dll
COMMENT "Copying Assimp binaries to '${TargetDirectory}'"
VERBATIM)
ENDFUNCTION(ASSIMP_COPY_BINARIES)
SET(assimp_LIBRARIES ${ASSIMP_LIBRARY_RELEASE})
endif()
else(WIN32)
FIND_LIBRARY(assimp_LIBRARY find_path(
NAMES assimp assimp_INCLUDE_DIRS
PATHS ${assimp_PREFIX} ${assimp_PREFIX}/lib NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h
) PATHS /usr/local/include
PATHS /usr/include/
INCLUDE(FindPackageHandleStandardArgs) )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(assimp DEFAULT_MSG assimp_LIBRARY assimp_INCLUDE_DIR)
mark_as_advanced(assimp_INCLUDE_DIR assimp_LIBRARY) find_library(
assimp_LIBRARIES
NAMES assimp
PATHS /usr/local/lib/
PATHS /usr/lib64/
PATHS /usr/lib/
)
if (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
SET(assimp_FOUND TRUE)
ENDIF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
if (assimp_FOUND)
if (NOT assimp_FIND_QUIETLY)
message(STATUS "Found asset importer library: ${assimp_LIBRARIES}")
endif (NOT assimp_FIND_QUIETLY)
else (assimp_FOUND)
if (assimp_FIND_REQUIRED)
message(FATAL_ERROR "Could not find asset importer library")
endif (assimp_FIND_REQUIRED)
endif (assimp_FOUND)
endif(WIN32)
...@@ -2,5 +2,7 @@ SET(DOXYGEN_XML_OUTPUT "doxygen-xml" PARENT_SCOPE) ...@@ -2,5 +2,7 @@ SET(DOXYGEN_XML_OUTPUT "doxygen-xml" PARENT_SCOPE)
SET(DOXYGEN_FILE_PATTERNS "*.h *.hh *.hxx" PARENT_SCOPE) SET(DOXYGEN_FILE_PATTERNS "*.h *.hh *.hxx" PARENT_SCOPE)
SET(DOXYGEN_GENERATE_XML "YES" PARENT_SCOPE) SET(DOXYGEN_GENERATE_XML "YES" PARENT_SCOPE)
SET(DOXYGEN_EXPAND_ONLY_PREDEF "NO" PARENT_SCOPE) SET(DOXYGEN_EXPAND_ONLY_PREDEF "NO" PARENT_SCOPE)
SET(DOXYGEN_ENABLE_PREPROCESSING "YES" PARENT_SCOPE)
SET(DOXYGEN_MACRO_EXPANSION "YES" PARENT_SCOPE)
SET(DOXYGEN_PREDEFINED "IS_DOXYGEN" PARENT_SCOPE) SET(DOXYGEN_PREDEFINED "IS_DOXYGEN" PARENT_SCOPE)
...@@ -245,12 +245,13 @@ static inline AABB rotate(const AABB& aabb, const Matrix3f& R) ...@@ -245,12 +245,13 @@ static inline AABB rotate(const AABB& aabb, const Matrix3f& R)
} }
/// @brief Check collision between two aabbs, b1 is in configuration (R0, T0) and b2 is in identity. /// @brief Check collision between two aabbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1, const AABB& b2) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1,
const AABB& b2);
/// @brief Check collision between two aabbs, b1 is in configuration (R0, T0) and b2 is in identity. /// @brief Check collision between two aabbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1, HPP_FCL_DLLAPI bool overlap(const Matrix3f& R0, const Vec3f& T0, const AABB& b1,
const AABB& b2, const CollisionRequest& request, const AABB& b2, const CollisionRequest& request,
FCL_REAL& sqrDistLowerBound) HPP_FCL_DLLAPI; FCL_REAL& sqrDistLowerBound);
} }
} // namespace hpp } // namespace hpp
......
...@@ -59,7 +59,7 @@ namespace details ...@@ -59,7 +59,7 @@ namespace details
/// @brief Convert a bounding volume of type BV1 in configuration tf1 to a bounding volume of type BV2 in I configuration. /// @brief Convert a bounding volume of type BV1 in configuration tf1 to a bounding volume of type BV2 in I configuration.
template<typename BV1, typename BV2> template<typename BV1, typename BV2>
class HPP_FCL_DLLAPI Converter class Converter
{ {
private: private:
static void convert(const BV1& /*bv1*/, const Transform3f& /*tf1*/, BV2& /*bv2*/) static void convert(const BV1& /*bv1*/, const Transform3f& /*tf1*/, BV2& /*bv2*/)
...@@ -71,7 +71,7 @@ private: ...@@ -71,7 +71,7 @@ private:
/// @brief Convert from AABB to AABB, not very tight but is fast. /// @brief Convert from AABB to AABB, not very tight but is fast.
template<> template<>
class HPP_FCL_DLLAPI Converter<AABB, AABB> class Converter<AABB, AABB>
{ {
public: public:
static void convert(const AABB& bv1, const Transform3f& tf1, AABB& bv2) static void convert(const AABB& bv1, const Transform3f& tf1, AABB& bv2)
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<AABB, OBB> class Converter<AABB, OBB>
{ {
public: public:
static void convert(const AABB& bv1, const Transform3f& tf1, OBB& bv2) static void convert(const AABB& bv1, const Transform3f& tf1, OBB& bv2)
...@@ -98,7 +98,7 @@ public: ...@@ -98,7 +98,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<OBB, OBB> class Converter<OBB, OBB>
{ {
public: public:
static void convert(const OBB& bv1, const Transform3f& tf1, OBB& bv2) static void convert(const OBB& bv1, const Transform3f& tf1, OBB& bv2)
...@@ -110,7 +110,7 @@ public: ...@@ -110,7 +110,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<OBBRSS, OBB> class Converter<OBBRSS, OBB>
{ {
public: public:
static void convert(const OBBRSS& bv1, const Transform3f& tf1, OBB& bv2) static void convert(const OBBRSS& bv1, const Transform3f& tf1, OBB& bv2)
...@@ -120,7 +120,7 @@ public: ...@@ -120,7 +120,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<RSS, OBB> class Converter<RSS, OBB>
{ {
public: public:
static void convert(const RSS& bv1, const Transform3f& tf1, OBB& bv2) static void convert(const RSS& bv1, const Transform3f& tf1, OBB& bv2)
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
template<typename BV1> template<typename BV1>
class HPP_FCL_DLLAPI Converter<BV1, AABB> class Converter<BV1, AABB>
{ {
public: public:
static void convert(const BV1& bv1, const Transform3f& tf1, AABB& bv2) static void convert(const BV1& bv1, const Transform3f& tf1, AABB& bv2)
...@@ -148,7 +148,7 @@ public: ...@@ -148,7 +148,7 @@ public:
}; };
template<typename BV1> template<typename BV1>
class HPP_FCL_DLLAPI Converter<BV1, OBB> class Converter<BV1, OBB>
{ {
public: public:
static void convert(const BV1& bv1, const Transform3f& tf1, OBB& bv2) static void convert(const BV1& bv1, const Transform3f& tf1, OBB& bv2)
...@@ -160,7 +160,7 @@ public: ...@@ -160,7 +160,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<OBB, RSS> class Converter<OBB, RSS>
{ {
public: public:
static void convert(const OBB& bv1, const Transform3f& tf1, RSS& bv2) static void convert(const OBB& bv1, const Transform3f& tf1, RSS& bv2)
...@@ -175,7 +175,7 @@ public: ...@@ -175,7 +175,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<RSS, RSS> class Converter<RSS, RSS>
{ {
public: public:
static void convert(const RSS& bv1, const Transform3f& tf1, RSS& bv2) static void convert(const RSS& bv1, const Transform3f& tf1, RSS& bv2)
...@@ -190,7 +190,7 @@ public: ...@@ -190,7 +190,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<OBBRSS, RSS> class Converter<OBBRSS, RSS>
{ {
public: public:
static void convert(const OBBRSS& bv1, const Transform3f& tf1, RSS& bv2) static void convert(const OBBRSS& bv1, const Transform3f& tf1, RSS& bv2)
...@@ -200,7 +200,7 @@ public: ...@@ -200,7 +200,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<AABB, RSS> class Converter<AABB, RSS>
{ {
public: public:
static void convert(const AABB& bv1, const Transform3f& tf1, RSS& bv2) static void convert(const AABB& bv1, const Transform3f& tf1, RSS& bv2)
...@@ -246,7 +246,7 @@ public: ...@@ -246,7 +246,7 @@ public:
}; };
template<> template<>
class HPP_FCL_DLLAPI Converter<AABB, OBBRSS> class Converter<AABB, OBBRSS>
{ {
public: public:
static void convert(const AABB& bv1, const Transform3f& tf1, OBBRSS& bv2) static void convert(const AABB& bv1, const Transform3f& tf1, OBBRSS& bv2)
......
...@@ -133,15 +133,16 @@ public: ...@@ -133,15 +133,16 @@ public:
/// @brief Translate the OBB bv /// @brief Translate the OBB bv
OBB translate(const OBB& bv, const Vec3f& t) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI OBB translate(const OBB& bv, const Vec3f& t);
/// @brief Check collision between two obbs, b1 is in configuration (R0, T0) and b2 is in identity. /// @brief Check collision between two obbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1, const OBB& b2) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI bool overlap(const Matrix3f& R0, const Vec3f& T0,
const OBB& b1, const OBB& b2);
/// @brief Check collision between two obbs, b1 is in configuration (R0, T0) and b2 is in identity. /// @brief Check collision between two obbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1, HPP_FCL_DLLAPI bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1,
const OBB& b2, const CollisionRequest& request, const OBB& b2, const CollisionRequest& request,
FCL_REAL& sqrDistLowerBound) HPP_FCL_DLLAPI; FCL_REAL& sqrDistLowerBound);
/// Check collision between two boxes /// Check collision between two boxes
...@@ -149,7 +150,8 @@ bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1, ...@@ -149,7 +150,8 @@ bool overlap(const Matrix3f& R0, const Vec3f& T0, const OBB& b1,
/// @param a half dimensions of first box, /// @param a half dimensions of first box,
/// @param b half dimensions of second box. /// @param b half dimensions of second box.
/// The second box is in identity configuration. /// The second box is in identity configuration.
bool obbDisjoint(const Matrix3f& B, const Vec3f& T, const Vec3f& a, const Vec3f& b) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI bool obbDisjoint(const Matrix3f& B, const Vec3f& T,
const Vec3f& a, const Vec3f& b);
} }
} // namespace hpp } // namespace hpp
......
...@@ -148,16 +148,20 @@ public: ...@@ -148,16 +148,20 @@ public:
/// @brief distance between two RSS bounding volumes /// @brief distance between two RSS bounding volumes
/// P and Q (optional return values) are the closest points in the rectangles, not the RSS. But the direction P - Q is the correct direction for cloest points /// P and Q (optional return values) are the closest points in the rectangles, not the RSS. But the direction P - Q is the correct direction for cloest points
/// Notice that P and Q are both in the local frame of the first RSS (not global frame and not even the local frame of object 1) /// Notice that P and Q are both in the local frame of the first RSS (not global frame and not even the local frame of object 1)
FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2, Vec3f* P = NULL, Vec3f* Q = NULL) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0,
const RSS& b1, const RSS& b2,
Vec3f* P = NULL, Vec3f* Q = NULL);
/// @brief Check collision between two RSSs, b1 is in configuration (R0, T0) and b2 is in identity. /// @brief Check collision between two RSSs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI bool overlap(const Matrix3f& R0, const Vec3f& T0,
const RSS& b1, const RSS& b2);
/// @brief Check collision between two RSSs, b1 is in configuration (R0, T0) and b2 is in identity. /// @brief Check collision between two RSSs, b1 is in configuration (R0, T0) and b2 is in identity.
bool overlap(const Matrix3f& R0, const Vec3f& T0, const RSS& b1, const RSS& b2, HPP_FCL_DLLAPI bool overlap(const Matrix3f& R0, const Vec3f& T0,
const CollisionRequest& request, const RSS& b1, const RSS& b2,
FCL_REAL& sqrDistLowerBound) HPP_FCL_DLLAPI; const CollisionRequest& request,
FCL_REAL& sqrDistLowerBound);
} }
......
...@@ -198,7 +198,7 @@ bool overlap(const Matrix3f& /*R0*/, const Vec3f& /*T0*/, ...@@ -198,7 +198,7 @@ bool overlap(const Matrix3f& /*R0*/, const Vec3f& /*T0*/,
/// @brief translate the KDOP BV /// @brief translate the KDOP BV
template<short N> template<short N>
KDOP<N> translate(const KDOP<N>& bv, const Vec3f& t) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI KDOP<N> translate(const KDOP<N>& bv, const Vec3f& t);
} }
......
...@@ -147,21 +147,25 @@ public: ...@@ -147,21 +147,25 @@ public:
/// @brief Translate the kIOS BV /// @brief Translate the kIOS BV
kIOS translate(const kIOS& bv, const Vec3f& t) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI kIOS translate(const kIOS& bv, const Vec3f& t);
/// @brief Check collision between two kIOSs, b1 is in configuration (R0, T0) and b2 is in identity. /// @brief Check collision between two kIOSs, b1 is in configuration (R0, T0) and b2 is in identity.
/// @todo Not efficient /// @todo Not efficient
bool overlap(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI bool overlap(const Matrix3f& R0, const Vec3f& T0,
const kIOS& b1, const kIOS& b2);
/// @brief Check collision between two kIOSs, b1 is in configuration (R0, T0) and b2 is in identity. /// @brief Check collision between two kIOSs, b1 is in configuration (R0, T0) and b2 is in identity.
/// @todo Not efficient /// @todo Not efficient
bool overlap(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2, HPP_FCL_DLLAPI bool overlap(const Matrix3f& R0, const Vec3f& T0,
const CollisionRequest& request, const kIOS& b1, const kIOS& b2,
FCL_REAL& sqrDistLowerBound) HPP_FCL_DLLAPI; const CollisionRequest& request,
FCL_REAL& sqrDistLowerBound);
/// @brief Approximate distance between two kIOS bounding volumes /// @brief Approximate distance between two kIOS bounding volumes
/// @todo P and Q is not returned, need implementation /// @todo P and Q is not returned, need implementation
FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2, Vec3f* P = NULL, Vec3f* Q = NULL) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI FCL_REAL distance(const Matrix3f& R0, const Vec3f& T0,
const kIOS& b1, const kIOS& b2,
Vec3f* P = NULL, Vec3f* Q = NULL);
} }
......
...@@ -49,22 +49,22 @@ namespace fcl ...@@ -49,22 +49,22 @@ namespace fcl
/// @brief Extract the part of the BVHModel that is inside an AABB. /// @brief Extract the part of the BVHModel that is inside an AABB.
/// A triangle in collision with the AABB is considered inside. /// A triangle in collision with the AABB is considered inside.
template<typename BV> template<typename BV>
BVHModel<BV>* BVHExtract(const BVHModel<BV>& model, const Transform3f& pose, const AABB& aabb) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI BVHModel<BV>* BVHExtract(const BVHModel<BV>& model, const Transform3f& pose, const AABB& aabb);
/// @brief Compute the covariance matrix for a set or subset of points. if ts = null, then indices refer to points directly; otherwise refer to triangles /// @brief Compute the covariance matrix for a set or subset of points. if ts = null, then indices refer to points directly; otherwise refer to triangles
void getCovariance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, Matrix3f& M) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI void getCovariance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, Matrix3f& M);
/// @brief Compute the RSS bounding volume parameters: radius, rectangle size and the origin, given the BV axises. /// @brief Compute the RSS bounding volume parameters: radius, rectangle size and the origin, given the BV axises.
void getRadiusAndOriginAndRectangleSize(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, const Matrix3f& axes, Vec3f& origin, FCL_REAL l[2], FCL_REAL& r) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI void getRadiusAndOriginAndRectangleSize(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, const Matrix3f& axes, Vec3f& origin, FCL_REAL l[2], FCL_REAL& r);
/// @brief Compute the bounding volume extent and center for a set or subset of points, given the BV axises. /// @brief Compute the bounding volume extent and center for a set or subset of points, given the BV axises.
void getExtentAndCenter(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, Matrix3f& axes, Vec3f& center, Vec3f& extent) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI void getExtentAndCenter(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, Matrix3f& axes, Vec3f& center, Vec3f& extent);
/// @brief Compute the center and radius for a triangle's circumcircle /// @brief Compute the center and radius for a triangle's circumcircle
void circumCircleComputation(const Vec3f& a, const Vec3f& b, const Vec3f& c, Vec3f& center, FCL_REAL& radius) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI void circumCircleComputation(const Vec3f& a, const Vec3f& b, const Vec3f& c, Vec3f& center, FCL_REAL& radius);
/// @brief Compute the maximum distance from a given center point to a point cloud /// @brief Compute the maximum distance from a given center point to a point cloud
FCL_REAL maximumDistance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, const Vec3f& query) HPP_FCL_DLLAPI; HPP_FCL_DLLAPI FCL_REAL maximumDistance(Vec3f* ps, Vec3f* ps2, Triangle* ts, unsigned int* indices, int n, const Vec3f& query);
} }
......
...@@ -52,13 +52,13 @@ namespace fcl ...@@ -52,13 +52,13 @@ namespace fcl
/// returning all the contact points), whether return detailed contact information (i.e., normal, contact point, depth; otherwise only contact primitive id is returned), this function /// returning all the contact points), whether return detailed contact information (i.e., normal, contact point, depth; otherwise only contact primitive id is returned), this function
/// performs the collision between them. /// performs the collision between them.
/// Return value is the number of contacts generated between the two objects. /// Return value is the number of contacts generated between the two objects.
std::size_t collide(const CollisionObject* o1, const CollisionObject* o2, HPP_FCL_DLLAPI std::size_t collide(const CollisionObject* o1, const CollisionObject* o2,
const CollisionRequest& request, CollisionResult& result) HPP_FCL_DLLAPI; const CollisionRequest& request, CollisionResult& result);