Skip to content
Snippets Groups Projects
Commit 52003c59 authored by Kaitlyn Lee's avatar Kaitlyn Lee Committed by Jesse Mapel
Browse files

Capitalized enum values.

parent 41a32cb9
No related branches found
No related tags found
No related merge requests found
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
namespace ale { namespace ale {
enum RotationInterpolation { enum RotationInterpolation {
slerp, // Spherical interpolation SLERP, // Spherical interpolation
nlerp // Normalized linear interpolation NLERP // Normalized linear interpolation
}; };
/** /**
......
...@@ -249,10 +249,10 @@ namespace ale { ...@@ -249,10 +249,10 @@ namespace ale {
) const { ) const {
Eigen::Quaterniond interpQuat; Eigen::Quaterniond interpQuat;
switch (interpType) { switch (interpType) {
case slerp: case SLERP:
interpQuat = m_impl->quat.slerp(t, nextRotation.m_impl->quat); interpQuat = m_impl->quat.slerp(t, nextRotation.m_impl->quat);
break; break;
case nlerp: case NLERP:
interpQuat = Eigen::Quaterniond( interpQuat = Eigen::Quaterniond(
linearInterpolate(m_impl->quat.w(), nextRotation.m_impl->quat.w(), t), linearInterpolate(m_impl->quat.w(), nextRotation.m_impl->quat.w(), t),
linearInterpolate(m_impl->quat.x(), nextRotation.m_impl->quat.x(), t), linearInterpolate(m_impl->quat.x(), nextRotation.m_impl->quat.x(), t),
......
...@@ -390,7 +390,7 @@ TEST(RotationTest, MultiplyRotation) { ...@@ -390,7 +390,7 @@ TEST(RotationTest, MultiplyRotation) {
TEST(RotationTest, Slerp) { TEST(RotationTest, Slerp) {
Rotation rotationOne(0.5, 0.5, 0.5, 0.5); Rotation rotationOne(0.5, 0.5, 0.5, 0.5);
Rotation rotationTwo(-0.5, 0.5, 0.5, 0.5); Rotation rotationTwo(-0.5, 0.5, 0.5, 0.5);
Rotation interpRotation = rotationOne.interpolate(rotationTwo, 0.125, ale::slerp); Rotation interpRotation = rotationOne.interpolate(rotationTwo, 0.125, ale::SLERP);
vector<double> quat = interpRotation.toQuaternion(); vector<double> quat = interpRotation.toQuaternion();
ASSERT_EQ(quat.size(), 4); ASSERT_EQ(quat.size(), 4);
EXPECT_NEAR(quat[0], cos(M_PI * 3.0/8.0), 1e-10); EXPECT_NEAR(quat[0], cos(M_PI * 3.0/8.0), 1e-10);
...@@ -402,7 +402,7 @@ TEST(RotationTest, Slerp) { ...@@ -402,7 +402,7 @@ TEST(RotationTest, Slerp) {
TEST(RotationTest, SlerpExtrapolate) { TEST(RotationTest, SlerpExtrapolate) {
Rotation rotationOne(0.5, 0.5, 0.5, 0.5); Rotation rotationOne(0.5, 0.5, 0.5, 0.5);
Rotation rotationTwo(-0.5, 0.5, 0.5, 0.5); Rotation rotationTwo(-0.5, 0.5, 0.5, 0.5);
Rotation interpRotation = rotationOne.interpolate(rotationTwo, 1.125, ale::slerp); Rotation interpRotation = rotationOne.interpolate(rotationTwo, 1.125, ale::SLERP);
vector<double> quat = interpRotation.toQuaternion(); vector<double> quat = interpRotation.toQuaternion();
ASSERT_EQ(quat.size(), 4); ASSERT_EQ(quat.size(), 4);
EXPECT_NEAR(quat[0], cos(M_PI * 17.0/24.0), 1e-10); EXPECT_NEAR(quat[0], cos(M_PI * 17.0/24.0), 1e-10);
...@@ -414,7 +414,7 @@ TEST(RotationTest, SlerpExtrapolate) { ...@@ -414,7 +414,7 @@ TEST(RotationTest, SlerpExtrapolate) {
TEST(RotationTest, Nlerp) { TEST(RotationTest, Nlerp) {
Rotation rotationOne(0.5, 0.5, 0.5, 0.5); Rotation rotationOne(0.5, 0.5, 0.5, 0.5);
Rotation rotationTwo(-0.5, 0.5, 0.5, 0.5); Rotation rotationTwo(-0.5, 0.5, 0.5, 0.5);
Rotation interpRotation = rotationOne.interpolate(rotationTwo, 0.125, ale::nlerp); Rotation interpRotation = rotationOne.interpolate(rotationTwo, 0.125, ale::NLERP);
double scaling = 8.0 / sqrt(57.0); double scaling = 8.0 / sqrt(57.0);
vector<double> quat = interpRotation.toQuaternion(); vector<double> quat = interpRotation.toQuaternion();
ASSERT_EQ(quat.size(), 4); ASSERT_EQ(quat.size(), 4);
...@@ -427,7 +427,7 @@ TEST(RotationTest, Nlerp) { ...@@ -427,7 +427,7 @@ TEST(RotationTest, Nlerp) {
TEST(RotationTest, NlerpExtrapolate) { TEST(RotationTest, NlerpExtrapolate) {
Rotation rotationOne(0.5, 0.5, 0.5, 0.5); Rotation rotationOne(0.5, 0.5, 0.5, 0.5);
Rotation rotationTwo(-0.5, 0.5, 0.5, 0.5); Rotation rotationTwo(-0.5, 0.5, 0.5, 0.5);
Rotation interpRotation = rotationOne.interpolate(rotationTwo, 1.125, ale::nlerp); Rotation interpRotation = rotationOne.interpolate(rotationTwo, 1.125, ale::NLERP);
double scaling = 8.0 / sqrt(73.0); double scaling = 8.0 / sqrt(73.0);
vector<double> quat = interpRotation.toQuaternion(); vector<double> quat = interpRotation.toQuaternion();
ASSERT_EQ(quat.size(), 4); ASSERT_EQ(quat.size(), 4);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment