[wpimath] Add 2D to 3D geometry constructors (#7380)

This commit is contained in:
Joseph Eng
2024-11-12 15:18:37 -08:00
committed by GitHub
parent 6adad7bad7
commit 425bf83036
8 changed files with 70 additions and 0 deletions

View File

@@ -229,6 +229,16 @@ class WPILIB_DLLEXPORT Rotation3d {
}
}
/**
* Constructs a 3D rotation from a 2D rotation in the X-Y plane.
*
* @param rotation The 2D rotation.
* @see Pose3d(Pose2d)
* @see Transform3d(Transform2d)
*/
constexpr explicit Rotation3d(const Rotation2d& rotation)
: Rotation3d{0_rad, 0_rad, rotation.Radians()} {}
/**
* Adds two rotations together.
*