00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef RC_QUATERNIONS_H
00011 #define RC_QUATERNIONS_H
00012
00013 class quat
00014 {
00015 public:
00016
00017
00018
00019 quat();
00020
00021 quat(
00022 const quat &nvec
00023 );
00024
00025 quat(
00026 f32 nx,
00027 f32 ny,
00028 f32 nz,
00029 f32 nw
00030 );
00031
00032 quat(
00033 vec3f nvec,
00034 f32 nw
00035 );
00036
00037 quat(
00038 vec4f nvec
00039 );
00040
00041
00042
00043 void operator=(
00044 const quat &v
00045 );
00046
00047 void operator=(
00048 const vec4f &v
00049 );
00050
00051 void operator=(
00052 const mat4f &v
00053 );
00054
00055 void operator=(
00056 const mat3f &v
00057 );
00058
00059
00060
00061 bool operator==(
00062 const quat &v
00063 );
00064
00065 bool operator!=(
00066 const quat &v
00067 );
00068
00069
00070
00071 quat operator+(
00072 const quat &v
00073 );
00074
00075 void operator+=(
00076 const quat &v
00077 );
00078
00079 quat operator+();
00080
00081
00082
00083 quat operator-(
00084 const quat &v
00085 );
00086
00087 void operator-=(
00088 const quat &v
00089 );
00090
00091 quat operator-();
00092
00093
00094
00095 quat operator*(
00096 const quat &v
00097 );
00098
00099 void operator*=(
00100 const quat &v
00101 );
00102
00103
00104
00105 void conjugate();
00106
00107 f32 norm();
00108
00109 void normalize();
00110
00111 void inverse();
00112
00113 void fromMatrix(
00114 mat3f v
00115 );
00116
00117 void fromMatrix(
00118 mat4f v
00119 );
00120
00121 mat3f unitTo3x3Matrix();
00122
00123 mat4f unitTo4x4Matrix();
00124
00125 void slerp(
00126 quat from,
00127 quat to,
00128 f32 t
00129 );
00130
00131 public:
00132
00133 f32 x;
00134 f32 y;
00135 f32 z;
00136 f32 w;
00137
00138 };
00139
00140
00141
00142
00143 #endif
00144