commit | author | age
|
69b66f
|
1 |
/************************************************************************
|
JS |
2 |
|
|
3 |
POLHEMUS PROPRIETARY
|
|
4 |
|
|
5 |
Polhemus
|
|
6 |
P.O. Box 560
|
|
7 |
Colchester, Vermont 05446
|
|
8 |
(802) 655-3159
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
Copyright © 2005 by Polhemus
|
|
14 |
All Rights Reserved.
|
|
15 |
|
|
16 |
|
|
17 |
*************************************************************************/
|
|
18 |
|
|
19 |
// Quaternion.h: interface for the CQuaternion class.
|
|
20 |
//
|
|
21 |
//////////////////////////////////////////////////////////////////////
|
|
22 |
|
|
23 |
#if !defined(AFX_QUATERNION_H__D76D8B96_F74D_41A4_869E_C3A397F9AA7A__INCLUDED_)
|
|
24 |
#define AFX_QUATERNION_H__D76D8B96_F74D_41A4_869E_C3A397F9AA7A__INCLUDED_
|
|
25 |
|
|
26 |
|
|
27 |
class CQuaternion
|
|
28 |
{
|
|
29 |
private:
|
|
30 |
void Normalize();
|
|
31 |
float q0;
|
|
32 |
float q1;
|
|
33 |
float q2;
|
|
34 |
float q3;
|
|
35 |
public:
|
|
36 |
CQuaternion Slerp(const CQuaternion& q, float t) const;
|
|
37 |
CQuaternion operator+(const CQuaternion& q1) const;
|
|
38 |
void GetAngle(float& a,bool deg=true);
|
|
39 |
void SetFromEulers(float* eul, bool deg=true);
|
|
40 |
void MakeLargestElementPos();
|
|
41 |
static void Quats2Eul(float* eul,float* quats,bool isDeg=true);
|
|
42 |
static void Eul2Quat(float* quat,float* eul,bool isDeg=true);
|
|
43 |
bool IsIdentity();
|
|
44 |
void SetQuatVals(const float w,const float x,const float y,const float z);
|
|
45 |
void SetQuatVals(const float val[4]);
|
|
46 |
float GetQuatVal(int ind) const;
|
|
47 |
void GetQuatVal(float vals[4]) const;
|
|
48 |
CQuaternion operator-(const CQuaternion& quat)const;
|
|
49 |
CQuaternion GetDeltaQuat(const CQuaternion& quat) const;
|
|
50 |
void GetAxisAngle(float vect[3],float& angle,bool deg=true) const;
|
|
51 |
CQuaternion operator -() const;
|
|
52 |
CQuaternion operator*(const CQuaternion& quat2) const;
|
|
53 |
CQuaternion operator*(const float ) const;
|
|
54 |
void operator *=(const CQuaternion &quat);
|
|
55 |
void GetAttMat(float mat[3][3]) const;
|
|
56 |
void GetEuler(float aer[3],bool deg=true) const;
|
|
57 |
void GetEuler(float& az,float& el,float& rl,bool deg=true) const;
|
|
58 |
CQuaternion(const float vect[3],float angle,bool deg=true);
|
|
59 |
CQuaternion(float q0,float q1,float q2,float q3);
|
|
60 |
CQuaternion(const float q[4]);
|
|
61 |
CQuaternion(float az, float el,float roll,bool deg=true);
|
|
62 |
CQuaternion();
|
|
63 |
virtual ~CQuaternion();
|
|
64 |
|
|
65 |
};
|
|
66 |
|
|
67 |
#endif // !defined(AFX_QUATERNION_H__D76D8B96_F74D_41A4_869E_C3A397F9AA7A__INCLUDED_)
|