cgv
Loading...
Searching...
No Matches
pose.h File Reference

helper functions to work with poses that can be represented with 3x4 matrix or quaternion plus vector More...

#include "fvec.h"
#include "fmat.h"
#include "quaternion.h"
#include <cassert>

Go to the source code of this file.

Namespaces

namespace  cgv
 the cgv namespace
 

Functions

template<typename T >
fmat< T, 3, 3 > & cgv::math::pose_orientation (fmat< T, 3, 4 > &pose)
 extract orientation matrix from pose matrix
 
template<typename T >
const fmat< T, 3, 3 > & cgv::math::pose_orientation (const fmat< T, 3, 4 > &pose)
 
template<typename T >
fvec< T, 3 > & cgv::math::pose_position (fmat< T, 3, 4 > &pose)
 extract position vector from pose matrix
 
template<typename T >
const fvec< T, 3 > & cgv::math::pose_position (const fmat< T, 3, 4 > &pose)
 
template<typename T >
fvec< T, 3 > cgv::math::pose_transform_point (const fmat< T, 3, 4 > &pose, const fvec< T, 3 > &p)
 transform point with pose matrix
 
template<typename T >
fvec< T, 3 > cgv::math::pose_transform_point (const quaternion< T > &q, const fvec< T, 3 > &pos, const fvec< T, 3 > &p)
 transform point with pose quaternion-position pair
 
template<typename T >
fvec< T, 3 > cgv::math::pose_transform_vector (const fmat< T, 3, 4 > &pose, const fvec< T, 3 > &v)
 transform vector with pose matrix
 
template<typename T >
fvec< T, 3 > cgv::math::inverse_pose_transform_point (const fmat< T, 3, 4 > &pose, const fvec< T, 3 > &p)
 transform point with inverse of pose matrix
 
template<typename T >
fvec< T, 3 > cgv::math::inverse_pose_transform_vector (const fmat< T, 3, 4 > &pose, const fvec< T, 3 > &v)
 transform vector with inverse of pose matrix
 
template<typename T >
void cgv::math::invert_pose (fmat< T, 3, 4 > &pose)
 inplace inversion of pose transformation
 
template<typename T >
fmat< T, 3, 4 > cgv::math::pose_inverse (const fmat< T, 3, 4 > &pose)
 return a pose matrix with the inverse pose transformation
 
template<typename T >
fmat< T, 3, 4 > cgv::math::pose_construct (const fmat< T, 3, 3 > &orientation, const fvec< T, 3 > &position)
 construct pose from rotation matrix and position vector
 
template<typename T >
fmat< T, 3, 4 > cgv::math::pose_construct (const quaternion< T > &orientation, const fvec< T, 3 > &position)
 construct pose from rotation quaternion and position vector
 
template<typename T >
void cgv::math::pose_append (fmat< T, 3, 4 > &pose_1, const fmat< T, 3, 4 > &pose_2)
 inplace concatenation of a pose matrix
 
template<typename T >
void cgv::math::pose_transform (const fmat< T, 3, 4 > &pose_transform, fmat< T, 3, 4 > &pose)
 inplace transformation of a pose matrix with another pose transformation matrix
 
template<typename T >
fmat< T, 3, 4 > cgv::math::pose_concat (const fmat< T, 3, 4 > &pose_1, const fmat< T, 3, 4 > &pose_2)
 return concatenate of two pose transformations
 

Detailed Description

helper functions to work with poses that can be represented with 3x4 matrix or quaternion plus vector

Definition in file pose.h.

Function Documentation

◆ inverse_pose_transform_point()

template<typename T >
fvec< T, 3 > cgv::math::inverse_pose_transform_point ( const fmat< T, 3, 4 > &  pose,
const fvec< T, 3 > &  p 
)

transform point with inverse of pose matrix

Definition at line 33 of file pose.h.

References cgv::math::inverse_pose_transform_point(), cgv::math::pose_orientation(), and cgv::math::pose_position().

Referenced by cgv::math::inverse_pose_transform_point().

◆ inverse_pose_transform_vector()

template<typename T >
fvec< T, 3 > cgv::math::inverse_pose_transform_vector ( const fmat< T, 3, 4 > &  pose,
const fvec< T, 3 > &  v 
)

transform vector with inverse of pose matrix

Definition at line 36 of file pose.h.

References cgv::math::inverse_pose_transform_vector(), and cgv::math::pose_orientation().

Referenced by cgv::math::inverse_pose_transform_vector().

◆ invert_pose()

template<typename T >
void cgv::math::invert_pose ( fmat< T, 3, 4 > &  pose)

inplace inversion of pose transformation

Definition at line 38 of file pose.h.

References cgv::math::invert_pose(), cgv::math::pose_orientation(), and cgv::math::pose_position().

Referenced by cgv::math::invert_pose(), and cgv::math::pose_inverse().

◆ pose_append()

template<typename T >
void cgv::math::pose_append ( fmat< T, 3, 4 > &  pose_1,
const fmat< T, 3, 4 > &  pose_2 
)

inplace concatenation of a pose matrix

Definition at line 46 of file pose.h.

References cgv::math::pose_append(), cgv::math::pose_orientation(), and cgv::math::pose_position().

Referenced by cgv::math::pose_append(), and cgv::math::pose_concat().

◆ pose_concat()

template<typename T >
fmat< T, 3, 4 > cgv::math::pose_concat ( const fmat< T, 3, 4 > &  pose_1,
const fmat< T, 3, 4 > &  pose_2 
)

return concatenate of two pose transformations

Definition at line 56 of file pose.h.

References cgv::math::pose_append(), and cgv::math::pose_concat().

Referenced by cgv::math::pose_concat().

◆ pose_construct() [1/2]

template<typename T >
fmat< T, 3, 4 > cgv::math::pose_construct ( const fmat< T, 3, 3 > &  orientation,
const fvec< T, 3 > &  position 
)

construct pose from rotation matrix and position vector

Definition at line 42 of file pose.h.

References cgv::math::pose_construct(), cgv::math::pose_orientation(), and cgv::math::pose_position().

Referenced by cgv::math::camera< T >::camera(), cgv::math::pose_construct(), and cgv::math::pose_construct().

◆ pose_construct() [2/2]

template<typename T >
fmat< T, 3, 4 > cgv::math::pose_construct ( const quaternion< T > &  orientation,
const fvec< T, 3 > &  position 
)

construct pose from rotation quaternion and position vector

Definition at line 44 of file pose.h.

References cgv::math::pose_construct(), cgv::math::pose_orientation(), cgv::math::pose_position(), and cgv::math::quaternion< T >::put_matrix().

◆ pose_inverse()

template<typename T >
fmat< T, 3, 4 > cgv::math::pose_inverse ( const fmat< T, 3, 4 > &  pose)

return a pose matrix with the inverse pose transformation

Definition at line 40 of file pose.h.

References cgv::math::invert_pose(), and cgv::math::pose_inverse().

Referenced by cgv::math::pose_inverse().

◆ pose_orientation() [1/2]

template<typename T >
const fmat< T, 3, 3 > & cgv::math::pose_orientation ( const fmat< T, 3, 4 > &  pose)

Definition at line 17 of file pose.h.

◆ pose_orientation() [2/2]

◆ pose_position() [1/2]

template<typename T >
const fvec< T, 3 > & cgv::math::pose_position ( const fmat< T, 3, 4 > &  pose)

Definition at line 20 of file pose.h.

◆ pose_position() [2/2]

template<typename T >
fvec< T, 3 > & cgv::math::pose_position ( fmat< T, 3, 4 > &  pose)

◆ pose_transform()

template<typename T >
void cgv::math::pose_transform ( const fmat< T, 3, 4 > &  pose_transform,
fmat< T, 3, 4 > &  pose 
)

inplace transformation of a pose matrix with another pose transformation matrix

Definition at line 51 of file pose.h.

References cgv::math::pose_orientation(), cgv::math::pose_position(), and cgv::math::pose_transform().

Referenced by cgv::math::pose_transform().

◆ pose_transform_point() [1/2]

template<typename T >
fvec< T, 3 > cgv::math::pose_transform_point ( const fmat< T, 3, 4 > &  pose,
const fvec< T, 3 > &  p 
)

◆ pose_transform_point() [2/2]

template<typename T >
fvec< T, 3 > cgv::math::pose_transform_point ( const quaternion< T > &  q,
const fvec< T, 3 > &  pos,
const fvec< T, 3 > &  p 
)

transform point with pose quaternion-position pair

Definition at line 27 of file pose.h.

References cgv::math::quaternion< T >::get_rotated(), and cgv::math::pose_transform_point().

◆ pose_transform_vector()

template<typename T >
fvec< T, 3 > cgv::math::pose_transform_vector ( const fmat< T, 3, 4 > &  pose,
const fvec< T, 3 > &  v 
)

transform vector with pose matrix

Definition at line 30 of file pose.h.

References cgv::math::pose_orientation(), and cgv::math::pose_transform_vector().

Referenced by cgv::math::pose_transform_vector().