25 #ifndef INCLUDED_Transform_h_GUID_8BF4BBD8_CDC1_48BC_DC27_BFDA42A3212E 26 #define INCLUDED_Transform_h_GUID_8BF4BBD8_CDC1_48BC_DC27_BFDA42A3212E 47 : m_pre(Eigen::Matrix4d::Identity()),
48 m_post(Eigen::Matrix4d::Identity()) {}
50 template <
typename T1,
typename T2>
51 Transform(T1
const &pre_matrix, T2
const &post_matrix)
52 : m_pre(pre_matrix), m_post(post_matrix) {}
54 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
56 template <
typename T>
void concatPre(
T const &xform) { m_pre *= xform; }
58 template <
typename T>
void concatPost(
T const &xform) {
59 m_post = (xform * m_post).eval();
65 concatPre(other.m_pre);
66 concatPost(other.m_post);
70 Eigen::Matrix4d
transform(Eigen::Matrix4d
const &input)
const {
71 return m_post * input * m_pre;
88 Eigen::Matrix4d
const &getPre()
const {
return m_pre; }
90 Eigen::Matrix4d
const &getPost()
const {
return m_post; }
109 Eigen::Matrix4d m_pre;
110 Eigen::Matrix4d m_post;
113 template <
typename T>
114 inline Eigen::Matrix4d rotate(
double degrees,
T const &axis) {
123 #endif // INCLUDED_Transform_h_GUID_8BF4BBD8_CDC1_48BC_DC27_BFDA42A3212E
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Header wrapping include of <Eigen/Core> and <Eigen/Geometry> for warning quieting.
Definition: ForwardDeclarations.h:236
A matrix or vector expression mapping an existing expressions.
Definition: Ref.h:17
Definition: Quaternion.h:47
Quaternion< double > Quaterniond
double precision quaternion type
Definition: Quaternion.h:211
Definition: ForwardDeclarations.h:235