18 #ifndef GZ_PHYSICS_GEOMETRY_HH_
19 #define GZ_PHYSICS_GEOMETRY_HH_
21 #include <Eigen/Geometry>
23 #define DETAIL_GZ_PHYSICS_MAKE_BOTH_PRECISIONS(Type, Dim) \
24 using Type ## Dim ## d = Type<double, Dim>; \
25 using Type ## Dim ## f = Type<float, Dim>;
32 #define GZ_PHYSICS_MAKE_ALL_TYPE_COMBOS(Type) \
33 DETAIL_GZ_PHYSICS_MAKE_BOTH_PRECISIONS(Type, 2) \
34 DETAIL_GZ_PHYSICS_MAKE_BOTH_PRECISIONS(Type, 3)
43 template <
typename Scalar, std::
size_t Dim>
44 using Pose = Eigen::Transform<Scalar, Dim, Eigen::Isometry>;
47 template <
typename Scalar, std::
size_t Dim>
48 using Vector = Eigen::Matrix<Scalar, Dim, 1>;
51 template <
typename Scalar, std::
size_t Dim>
55 template <
typename Scalar, std::
size_t Dim>
59 template <
typename Scalar, std::
size_t Dim>
67 template <
typename Scalar, std::
size_t Dim>
76 template <
typename PolicyT>
79 using Scalar =
typename PolicyT::Scalar;
80 enum {
Dim = PolicyT::Dim };
82 template<
template <
typename, std::
size_t>
class Type>
83 using Use = Type<Scalar, Dim>;
86 template<
typename Scalar>
91 return Eigen::Rotation2D<Scalar>(_angle*_axis[0]);
94 template <
typename Scalar>
99 return Eigen::AngleAxis<Scalar>(_angle, _axis);