35 #ifdef OSG_USE_FLOAT_QUAT
85 makeRotate(angle1,axis1,angle2,axis2,angle3,axis3);
92 makeRotate(angle1,axis1,angle2,axis2,angle3,axis3);
97 inline bool operator == (
const Quat& v)
const {
return _v[0]==v.
_v[0] &&
_v[1]==v.
_v[1] &&
_v[2]==v.
_v[2] &&
_v[3]==v.
_v[3]; }
99 inline bool operator != (
const Quat& v)
const {
return _v[0]!=v.
_v[0] ||
_v[1]!=v.
_v[1] ||
_v[2]!=v.
_v[2] ||
_v[3]!=v.
_v[3]; }
101 inline bool operator < (
const Quat& v)
const
103 if (
_v[0]<v.
_v[0])
return true;
104 else if (
_v[0]>v.
_v[0])
return false;
105 else if (
_v[1]<v.
_v[1])
return true;
106 else if (
_v[1]>v.
_v[1])
return false;
107 else if (
_v[2]<v.
_v[2])
return true;
108 else if (
_v[2]>v.
_v[2])
return false;
109 else return (
_v[3]<v.
_v[3]);
186 return Quat(
_v[0]*rhs,
_v[1]*rhs,
_v[2]*rhs,
_v[3]*rhs);
227 return Quat(
_v[0]*div,
_v[1]*div,
_v[2]*div,
_v[3]*div);
244 return ( (*
this) * denom.
inverse() );
250 (*this) = (*this) * denom.
inverse();
255 inline const Quat operator + (
const Quat& rhs)
const
272 inline const Quat operator - (
const Quat& rhs)
const
290 inline const Quat operator - ()
const
377 uv *= ( 2.0f *
_v[3] );
390 uv *= ( 2.0f *
_v[3] );
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
value_type x() const
Definition Quat:167
void set(const Matrixf &matrix)
Quat(value_type angle, const Vec3d &axis)
Definition Quat:76
void getRotate(value_type &angle, Vec3d &vec) const
Return the angle and vector represented by the quaternion.
value_type & w()
Definition Quat:165
bool zeroRotation() const
return true if the Quat represents a zero rotation, and therefore can be ignored in computations.
Definition Quat:173
Vec4d asVec4() const
Definition Quat:116
value_type y() const
Definition Quat:168
const Quat operator*(const Quat &rhs) const
Binary multiply.
Definition Quat:200
const Quat operator/(const Quat &denom) const
Binary divide.
Definition Quat:242
const Quat inverse() const
Multiplicative inverse method: q^(-1) = q^*/(q.q^*)
Definition Quat:314
@ num_components
Definition Quat:42
Quat(value_type angle, const Vec3f &axis)
Definition Quat:72
void makeRotate(value_type angle, const Vec3d &vec)
Quat(value_type x, value_type y, value_type z, value_type w)
Definition Quat:48
void set(const osg::Vec4d &v)
Definition Quat:142
void getRotate(value_type &angle, Vec3f &vec) const
Return the angle and vector represented by the quaternion.
value_type & y()
Definition Quat:163
value_type length() const
Length of the quaternion = sqrt( vec . vec )
Definition Quat:296
void makeRotate(value_type angle1, const Vec3f &axis1, value_type angle2, const Vec3f &axis2, value_type angle3, const Vec3f &axis3)
void makeRotate(value_type angle, value_type x, value_type y, value_type z)
void makeRotate(const Vec3f &vec1, const Vec3f &vec2)
Make a rotation Quat which will rotate vec1 to vec2.
void getRotate(value_type &angle, value_type &x, value_type &y, value_type &z) const
Return the angle and vector components represented by the quaternion.
void makeRotate_original(const Vec3d &vec1, const Vec3d &vec2)
Vec3d asVec3() const
Definition Quat:121
value_type & x()
Definition Quat:162
Quat conj() const
Conjugate.
Definition Quat:308
Quat(const Vec4f &v)
Definition Quat:56
void get(Matrixf &matrix) const
value_type & z()
Definition Quat:164
value_type _v[4]
Definition Quat:44
void makeRotate(value_type angle, const Vec3f &vec)
Quat & operator/=(const Quat &denom)
Unary divide.
Definition Quat:248
Quat & operator*=(const Quat &rhs)
Unary multiply.
Definition Quat:209
Quat(value_type angle1, const Vec3f &axis1, value_type angle2, const Vec3f &axis2, value_type angle3, const Vec3f &axis3)
Definition Quat:81
void set(value_type x, value_type y, value_type z, value_type w)
Definition Quat:126
void makeRotate(const Vec3d &vec1, const Vec3d &vec2)
Make a rotation Quat which will rotate vec1 to vec2.
double value_type
Data type of vector components.
Definition Quat:38
value_type z() const
Definition Quat:169
void set(const Matrixd &matrix)
Quat(value_type angle1, const Vec3d &axis1, value_type angle2, const Vec3d &axis2, value_type angle3, const Vec3d &axis3)
Definition Quat:88
value_type w() const
Definition Quat:170
Quat(const Vec4d &v)
Definition Quat:64
void get(Matrixd &matrix) const
void makeRotate(value_type angle1, const Vec3d &axis1, value_type angle2, const Vec3d &axis2, value_type angle3, const Vec3d &axis3)
value_type length2() const
Length of the quaternion = vec . vec.
Definition Quat:302
void slerp(value_type t, const Quat &from, const Quat &to)
Spherical Linear Interpolation.
void set(const osg::Vec4f &v)
Definition Quat:134
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
General purpose float triple for use as vertices, vectors and normals.
Definition Vec3f:29
General purpose double quad.
Definition Vec4d:29
value_type & x()
Definition Vec4d:90
value_type & y()
Definition Vec4d:91
value_type & z()
Definition Vec4d:92
value_type & w()
Definition Vec4d:93
General purpose float quad.
Definition Vec4f:28
value_type & y()
Definition Vec4f:88
value_type & x()
Definition Vec4f:87
value_type & z()
Definition Vec4f:89
value_type & w()
Definition Vec4f:90
#define OSG_EXPORT
Definition Export:39