- Joined
- Mar 28, 2008
- Messages
- 669
- Reaction score
- 32
- Points
- 43
Hello,
I found a quaternion class/header here.
Does somebody knows how to use the "toEuler" - method?
I want to get it working like this (just a check if the current yaw, pitch and bank can be shown):
It seems that e[0],e[1] and e[2] are only used for reading.
So is there something wrong with this header file???
And what does the order value means?
I found a quaternion class/header here.
Does somebody knows how to use the "toEuler" - method?
Code:
...
// -parameters : integer order- which will specify the order of the rotation, q- quaternion
// -return value : Euler angle
// -
template<class _Tp>
void Quaternion<_Tp>::toEuler(_Tp e[3], int order)
{
Quat q;
q.w = 0;
q.x = e[0];
q.y = e[1];
q.z = e[2];
EulerAngles ea = Eul_FromQuat(q, order);
w = ea.w;
x = ea.x;
y = ea.y;
z = ea.z;
}
...
I want to get it working like this (just a check if the current yaw, pitch and bank can be shown):
Code:
VESSEL * ptrVessel = oapiGetFocusInterface();
Quaternion<double> q_setpoint(ptrVessel->GetYaw(), ptrVessel->GetPitch(), ptrVessel->GetBank(), 0);
double e[3] = {0,0,0};
q_setpoint.toEuler(e,0);
mfdi.lineBuffer[0] << "Yaw:" << e[0] << " Pitch:" << e[1] << " Roll:" << e[2];
So is there something wrong with this header file???
And what does the order value means?
Last edited: