27#include "utility/graphic/orientation.hpp"
28#include "utility/graphic/position.hpp"
31namespace utility::graphic
37 template<
typename Type>
50 template<CanBePoseComponent PoseComponentType>
class Pose
80 , _orientation(orientation)
122 _position = position;
154 _orientation = orientation;
238 return _position == other._position
239 && _orientation == other._orientation;
249 return !(*
this == other);
259 if (_position != other._position) {
260 return _position < other._position;
262 if (_orientation != other._orientation) {
263 return _orientation < other._orientation;
272 using PoseF = Pose<float>;
277 using PoseD = Pose<double>;
285 std::ostream &operator<<(std::ostream &stream,
const PoseF &pose);
293 std::ostream &operator<<(std::ostream &stream,
const PoseD &pose);
Represents the current 3D orientation (pose) of an object or view.
utility::math::Vector< OrientationComponentType, 3 > getForward(void) const noexcept
Get the forward (Z-) axis in world space.
utility::math::Vector< OrientationComponentType, 3 > getRight(void) const noexcept
Get the right (X+) axis in world space.
utility::math::Vector< OrientationComponentType, 3 > getUp(void) const noexcept
Get the up (Y+) axis in world space.
Template class representing a pose (Position + Orientation).
Pose & setOrientation(math::Quaternion< PoseComponentType > quaternion) noexcept
Set the orientation component using a quaternion.
Ray< PoseComponentType > toForwardRay() const noexcept
Get a ray representing the forward direction of the pose.
Pose & setPosition(math::Vector< PoseComponentType, 3 > position) noexcept
Set the position component using a vector.
Ray< PoseComponentType > toUpRay() const noexcept
Get a ray representing the right direction of the pose.
Pose & setPosition(const Position< PoseComponentType > &position) noexcept
Set the position component.
Pose & setOrientation(const Orientation< PoseComponentType > &orientation) noexcept
Set the orientation component.
Pose & operator=(Pose &&other) noexcept=default
Move assignment operator.
Pose(const Pose &other)=default
Copy constructor.
Pose(Pose &&other) noexcept=default
Move constructor.
Pose(const Position< PoseComponentType > &position, const Orientation< PoseComponentType > &orientation)
Construct a pose from position and orientation.
const Orientation< PoseComponentType > & getOrientation(void) const noexcept
Get the orientation component.
Pose & operator=(const Pose &other)=default
Copy assignment operator.
bool operator<(const Pose &other) const noexcept
Less-than comparison for ordering.
~Pose(void)=default
Default destructor for Pose.
Pose translated(const Position< PoseComponentType > &offset) const noexcept
Return translated copy of this pose.
bool operator==(const Pose &other) const noexcept
Equality comparison.
Pose(void)
Default constructor (zero position, identity orientation).
const Position< PoseComponentType > & getPosition(void) const noexcept
Get the position component.
bool operator!=(const Pose &other) const noexcept
Inequality comparison.
Ray< PoseComponentType > toRightRay() const noexcept
Get a ray representing the up direction of the pose.
Pose & translate(const Position< PoseComponentType > &offset) noexcept
Translate pose position by an offset.
Position in 3D space represented as a vector of three PositionComponentType components (x,...
Position & translate(const Position &offset) noexcept
Translate this position by an offset.
Geometric ray with arithmetic component type and fixed dimension.
Quaternion class inheriting from glm::qua.
3D vector class inheriting from glm::vec3.
Concept to constrain orientation component type.
Concept to constrain pose component type.
Concept to constrain position component type.
Geometric ray template declaration.