Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
hpp-fcl
Commits
ff8b2c31
Commit
ff8b2c31
authored
May 31, 2016
by
Joseph Mirabel
Committed by
Joseph Mirabel
Jun 14, 2016
Browse files
Make Eigen a required dependency and add fcl::Vec3fX::derived() (same
for Matrix3fX
parent
0ca44f58
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
ff8b2c31
...
...
@@ -48,13 +48,10 @@ setup_project()
set
(
FCL_HAVE_SSE FALSE CACHE BOOL
"Enable SSE vectorization"
)
add_optional_dependency
(
"eigen3 >= 3.0.0"
)
set
(
FCL_HAVE_EIGEN
${
EIGEN3_FOUND
}
CACHE BOOL
"Use eigen matrix type when possible"
)
if
(
EIGEN3_FOUND
)
if
(
FCL_HAVE_EIGEN
)
include_directories
(
${
EIGEN3_INCLUDE_DIRS
}
)
endif
(
FCL_HAVE_EIGEN
)
endif
(
EIGEN3_FOUND
)
# add_optional_dependency("eigen3 >= 3.0.0")
add_required_dependency
(
"eigen3 >= 3.0.0"
)
set
(
FCL_HAVE_EIGEN TRUE CACHE BOOL
"Use eigen matrix type when possible"
)
include_directories
(
${
EIGEN3_INCLUDE_DIRS
}
)
# Required dependencies
add_required_dependency
(
"ccd >= 1.4"
)
...
...
include/hpp/fcl/math/matrix_3fx.h
View file @
ff8b2c31
...
...
@@ -39,6 +39,7 @@
#define FCL_MATRIX_3FX_H
#include
<hpp/fcl/math/vec_3f.h>
#include
<Eigen/Core>
namespace
fcl
{
...
...
@@ -50,6 +51,7 @@ class Matrix3fX
public:
typedef
typename
T
::
meta_type
U
;
typedef
typename
T
::
vector_type
S
;
typedef
Eigen
::
Matrix
<
U
,
3
,
3
>
EigenType
;
T
data
;
Matrix3fX
()
{}
...
...
@@ -75,6 +77,15 @@ public:
return
Vec3fX
<
S
>
(
data
.
getRow
(
i
));
}
inline
EigenType
derived
()
const
{
EigenType
ret
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
for
(
int
j
=
0
;
j
<
3
;
++
j
)
ret
(
i
,
j
)
=
data
(
i
,
j
);
return
ret
;
}
inline
U
operator
()
(
size_t
i
,
size_t
j
)
const
{
return
data
(
i
,
j
);
...
...
include/hpp/fcl/math/vec_3fx.h
View file @
ff8b2c31
...
...
@@ -45,6 +45,7 @@
#include
<iostream>
#include
<limits>
#include
<Eigen/Core>
namespace
fcl
{
...
...
@@ -55,6 +56,7 @@ class Vec3fX
{
public:
typedef
typename
T
::
meta_type
U
;
typedef
Eigen
::
Matrix
<
U
,
3
,
1
>
EigenType
;
/// @brief interval vector3 data
T
data
;
...
...
@@ -71,6 +73,11 @@ public:
/// @brief create vector using the internal data type
Vec3fX
(
const
T
&
data_
)
:
data
(
data_
)
{}
inline
EigenType
derived
()
const
{
return
EigenType
(
data
[
0
],
data
[
1
],
data
[
2
]);
}
inline
U
operator
[]
(
size_t
i
)
const
{
return
data
[
i
];
}
inline
U
&
operator
[]
(
size_t
i
)
{
return
data
[
i
];
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment