mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[wpimath] Add 2D to 3D geometry constructors (#7380)
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user