Skip to content
Snippets Groups Projects
Commit c1ce92c6 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Python interface uses (x,y,z,w) convention for quaternions.

parent 460ab3c2
No related branches found
No related tags found
No related merge requests found
......@@ -63,14 +63,11 @@ namespace graphics {
typedef const GraphicalInterface::Transform In_t;
typedef Configuration Out_t;
typedef Transform_slice* Ret_t;
static Out_t op (In_t in) { return Out_t(in, false); /* false means (w,x,y,z) -> (x,y,z,w) */ }
static Out_t op (In_t in) { return Out_t(in, true); /* true = (x,y,z,w) -> (x,y,z,w), false = (w,x,y,z) -> (x,y,z,w) */ }
static Ret_t ret (const Out_t& in) {
Ret_t ret = new GraphicalInterface::Transform();
// dofArray->length(7);
for(int i=0; i<3; i++) ret[(ULong)i] = in.position[i];
// for(int i=0; i<3; i++) ret[(ULong)i+3] = (float)in.quat[i];
ret[(ULong)3] = (float)in.quat[3]; // W
for(int i=0; i<3; i++) ret[(ULong)i+4] = (float)in.quat[i]; // XYZ
for(int i=0; i<4; i++) ret[(ULong)i+3] = (float)in.quat[i];
return ret;
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment