33 #ifndef DART_GUI_OSG_UTILS_HPP_
34 #define DART_GUI_OSG_UTILS_HPP_
36 #include <Eigen/Geometry>
41 template<
typename Scalar>
42 ::osg::Matrix
eigToOsgMatrix(
const Eigen::Transform<Scalar,3,Eigen::Isometry>& tf)
45 tf(0, 0), tf(1, 0), tf(2, 0), tf(3, 0),
46 tf(0, 1), tf(1, 1), tf(2, 1), tf(3, 1),
47 tf(0, 2), tf(1, 2), tf(2, 2), tf(3, 2),
48 tf(0, 3), tf(1, 3), tf(2, 3), tf(3, 3));
52 template<
typename Derived>
56 M(0, 0), M(1, 0), M(2, 0), M(3, 0),
57 M(0, 1), M(1, 1), M(2, 1), M(3, 1),
58 M(0, 2), M(1, 2), M(2, 2), M(3, 2),
59 M(0, 3), M(1, 3), M(2, 3), M(3, 3));
63 template<
typename Derived>
66 return ::osg::Vec3d(vec[0], vec[1], vec[2]);
72 return Eigen::Vector3d(vec[0], vec[1], vec[2]);
76 template<
typename Derived>
79 return ::osg::Vec4d(vec[0], vec[1], vec[2], vec[3]);
85 return Eigen::Vector4d(vec[0], vec[1], vec[2], vec[3]);
Eigen::Vector3d osgToEigVec3(const ::osg::Vec3d &vec)
Definition: Utils.hpp:70
Eigen::Vector4d osgToEigVec4(const ::osg::Vec4d &vec)
Definition: Utils.hpp:83
::osg::Vec4d eigToOsgVec4(const Eigen::MatrixBase< Derived > &vec)
Definition: Utils.hpp:77
::osg::Vec3d eigToOsgVec3(const Eigen::MatrixBase< Derived > &vec)
Definition: Utils.hpp:64
::osg::Matrix eigToOsgMatrix(const Eigen::Transform< Scalar, 3, Eigen::Isometry > &tf)
Definition: Utils.hpp:42