Skip to content

Commit

Permalink
Fixed compilation and linking issues with transform functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilpincy committed Sep 25, 2023
1 parent f799ac2 commit 01a0b3c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ set(ARGOS3_SOURCES_CORE
utility/math/cylinder.cpp
utility/math/convex_hull.cpp
utility/math/pose2.cpp
utility/math/transforms.h
utility/math/transforms.cpp
utility/math/vector2.cpp
utility/math/vector3.cpp
utility/math/plane.cpp
Expand Down
43 changes: 22 additions & 21 deletions src/core/utility/math/transforms.cpp
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
#include "transforms.h"

using namespace argos;
namespace argos {

/****************************************/
/****************************************/
/****************************************/
/****************************************/

CVector3 GlobalToLocal(const CVector3& c_global,
const CVector3& c_translation,
const CQuaternion& c_orientation) {
CVector3 cLocal = c_global - c_translation;
cLocal.Rotate(c_orientation.Inverse());
return cLocal;
}
CVector3 GlobalToLocal(CVector3 c_global,
CVector3 c_translation,
CQuaternion c_orientation) {
CVector3 cLocal = c_global - c_translation;
cLocal.Rotate(c_orientation.Inverse());
return cLocal;
}

/****************************************/
/****************************************/
/****************************************/
/****************************************/

CVector3 LocalToGlobal(const CVector3& c_local,
const CVector3& c_translation,
const CQuaternion& c_orientation) {
CVector cGlobal = c_local.Rotate(c_orientation);
cGlobal += c_translation;
return cGlobal;
}
CVector3 LocalToGlobal(CVector3 c_local,
CVector3 c_translation,
CQuaternion c_orientation) {
CVector3 cGlobal = c_local.Rotate(c_orientation);
cGlobal += c_translation;
return cGlobal;
}

/****************************************/
/****************************************/
/****************************************/
/****************************************/

}
12 changes: 6 additions & 6 deletions src/core/utility/math/transforms.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

namespace argos {

CVector3 GlobalToLocal(const CVector3& c_global,
const CVector3& c_translation,
const CQuaternion& c_orientation);
CVector3 GlobalToLocal(CVector3 c_global,
CVector3 c_translation,
CQuaternion c_orientation);

CVector3 LocalToGlobal(const CVector3& c_local,
const CVector3& c_translation,
const CQuaternion& c_orientation);
CVector3 LocalToGlobal(CVector3 c_local,
CVector3 c_translation,
CQuaternion c_orientation);

}

Expand Down

0 comments on commit 01a0b3c

Please sign in to comment.