[wpimath] Make C++ geometry classes immutable (#3249)

This commit is contained in:
Prateek Machiraju
2021-03-19 16:38:54 -04:00
committed by GitHub
parent da96707dca
commit d3e45c297c
8 changed files with 2 additions and 126 deletions

View File

@@ -20,12 +20,6 @@ Pose2d Pose2d::operator+(const Transform2d& other) const {
return TransformBy(other);
}
Pose2d& Pose2d::operator+=(const Transform2d& other) {
m_translation += other.Translation().RotateBy(m_rotation);
m_rotation += other.Rotation();
return *this;
}
Transform2d Pose2d::operator-(const Pose2d& other) const {
const auto pose = this->RelativeTo(other);
return Transform2d(pose.Translation(), pose.Rotation());