1 #ifndef INVDYNEIGENINTERFACE_HPP_
2 #define INVDYNEIGENINTERFACE_HPP_
3 #include "../IDConfig.hpp"
4 namespace btInverseDynamics
5 {
6 #define BT_ID_HAVE_MAT3X
7
8 #ifdef BT_USE_DOUBLE_PRECISION
9 typedef Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::DontAlign> vecx;
10 typedef Eigen::Matrix<double, 3, 1, Eigen::DontAlign> vec3;
11 typedef Eigen::Matrix<double, 3, 3, Eigen::DontAlign> mat33;
12 typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign> matxx;
13 typedef Eigen::Matrix<double, 3, Eigen::Dynamic, Eigen::DontAlign> mat3x;
14 #else
15 typedef Eigen::Matrix<float, Eigen::Dynamic, 1, Eigen::DontAlign> vecx;
16 typedef Eigen::Matrix<float, 3, 1, Eigen::DontAlign> vec3;
17 typedef Eigen::Matrix<float, 3, 3, Eigen::DontAlign> mat33;
18 typedef Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::DontAlign> matxx;
19 typedef Eigen::Matrix<float, 3, Eigen::Dynamic, Eigen::DontAlign> mat3x;
20 #endif
21
resize(mat3x & m,Eigen::Index size)22 inline void resize(mat3x &m, Eigen::Index size)
23 {
24 m.resize(3, size);
25 m.setZero();
26 }
27
setMatxxElem(const idArrayIdx row,const idArrayIdx col,const idScalar val,matxx * m)28 inline void setMatxxElem(const idArrayIdx row, const idArrayIdx col, const idScalar val, matxx *m)
29 {
30 (*m)(row, col) = val;
31 }
32
setMat3xElem(const idArrayIdx row,const idArrayIdx col,const idScalar val,mat3x * m)33 inline void setMat3xElem(const idArrayIdx row, const idArrayIdx col, const idScalar val, mat3x *m)
34 {
35 (*m)(row, col) = val;
36 }
37
38 } // namespace btInverseDynamics
39 #endif // INVDYNEIGENINTERFACE_HPP_
40