Rerun C++ SDK
Loading...
Searching...
No Matches
rotation3d.hpp
1#pragma once
2
3#include <optional>
4
5#include "components/rotation_axis_angle.hpp"
6#include "components/rotation_quat.hpp"
7#include "datatypes/quaternion.hpp"
8#include "datatypes/rotation_axis_angle.hpp"
9
10namespace rerun {
11 /// Utility for representing a single 3D rotation, agnostic to the underlying representation.
12 ///
13 /// This is not a component, but a utility for building `rerun::Transform3D`.
14 struct Rotation3D {
15 std::optional<rerun::components::RotationAxisAngle> axis_angle;
16 std::optional<rerun::components::RotationQuat> quaternion;
17
18 public:
19 Rotation3D() : axis_angle(std::nullopt), quaternion(std::nullopt) {}
20
21 /// Construct a `Rotation3D` from a rotation axis and angle component.
22 Rotation3D(rerun::components::RotationAxisAngle axis_angle_) : axis_angle(axis_angle_) {}
23
24 /// Construct a `Rotation3D` from a quaternion component.
25 Rotation3D(rerun::components::RotationQuat quaternion_) : quaternion(quaternion_) {}
26
27 /// Construct a `Rotation3D` from a rotation axis and angle datatype.
28 Rotation3D(rerun::datatypes::RotationAxisAngle axis_angle_) : axis_angle(axis_angle_) {}
29
30 /// Construct a `Rotation3D` from a quaternion datatype.
31 Rotation3D(rerun::datatypes::Quaternion quaternion_) : quaternion(quaternion_) {}
32 };
33} // namespace rerun
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Utility for representing a single 3D rotation, agnostic to the underlying representation.
Definition rotation3d.hpp:14
Rotation3D(rerun::components::RotationAxisAngle axis_angle_)
Construct a Rotation3D from a rotation axis and angle component.
Definition rotation3d.hpp:22
Rotation3D(rerun::components::RotationQuat quaternion_)
Construct a Rotation3D from a quaternion component.
Definition rotation3d.hpp:25
Rotation3D(rerun::datatypes::RotationAxisAngle axis_angle_)
Construct a Rotation3D from a rotation axis and angle datatype.
Definition rotation3d.hpp:28
Rotation3D(rerun::datatypes::Quaternion quaternion_)
Construct a Rotation3D from a quaternion datatype.
Definition rotation3d.hpp:31
Component: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:14
Component: A 3D rotation expressed as a quaternion.
Definition rotation_quat.hpp:17
Datatype: A Quaternion represented by 4 real numbers.
Definition quaternion.hpp:24
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:21