mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add equality comparator to geometry classes (#1882)
This commit is contained in:
committed by
Peter Johnson
parent
62f07c182c
commit
86b666bba9
@@ -27,6 +27,14 @@ Pose2d& Pose2d::operator+=(const Transform2d& other) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool Pose2d::operator==(const Pose2d& other) const {
|
||||
return m_translation == other.m_translation && m_rotation == other.m_rotation;
|
||||
}
|
||||
|
||||
bool Pose2d::operator!=(const Pose2d& other) const {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
Pose2d Pose2d::TransformBy(const Transform2d& other) const {
|
||||
return {m_translation + (other.Translation().RotateBy(m_rotation)),
|
||||
m_rotation + other.Rotation()};
|
||||
|
||||
Reference in New Issue
Block a user