Changed the implementation of osg::Quat::makeRotate(heading,pitch,roll) so that
it conforms to the OpenFlight convention of euler angles. Added documentation into Matrix and Quat to reflect this. Added so test code to osgcube for stress testing memory allocation and deallocation. Commented out the registering of app and cull callbacks in osghud.
This commit is contained in:
@@ -94,7 +94,14 @@ class SG_EXPORT Matrix : public Object
|
||||
void makeRotate( float angle, const Vec3& axis );
|
||||
void makeRotate( float angle, float x, float y, float z );
|
||||
void makeRotate( const Quat& );
|
||||
void makeRotate( float, float, float ); //Euler angles
|
||||
|
||||
/** make a rotation Matrix from euler angles.
|
||||
* assume Z up, Y north, X east and euler convention
|
||||
* as per Open Flight & Performer.
|
||||
* Applies a positive rotation about Y axis for roll,
|
||||
* then applies a positive roation about X for pitch,
|
||||
* and finally a negative rotation about the Z axis.*/
|
||||
void makeRotate( float heading, float pitch, float roll); //Euler angles
|
||||
|
||||
|
||||
/** Set to a orthographic projection. See glOrtho for further details.*/
|
||||
@@ -127,15 +134,17 @@ class SG_EXPORT Matrix : public Object
|
||||
|
||||
//basic utility functions to create new matrices
|
||||
inline static Matrix identity( void );
|
||||
inline static Matrix scale( const Vec3& );
|
||||
inline static Matrix scale( float, float, float );
|
||||
inline static Matrix translate( const Vec3& );
|
||||
inline static Matrix translate( float, float, float );
|
||||
inline static Matrix rotate( const Vec3&, const Vec3& );
|
||||
inline static Matrix rotate( float, float, float, float );
|
||||
inline static Matrix scale( const Vec3& sv);
|
||||
inline static Matrix scale( float sx, float sy, float sz);
|
||||
inline static Matrix translate( const Vec3& dv);
|
||||
inline static Matrix translate( float x, float y, float z);
|
||||
inline static Matrix rotate( const Vec3& from, const Vec3& to);
|
||||
inline static Matrix rotate( float angle, float x, float y, float z);
|
||||
inline static Matrix rotate( float angle, const Vec3& axis);
|
||||
inline static Matrix rotate( const Quat&);
|
||||
inline static Matrix inverse( const Matrix&);
|
||||
/** construct rotation matrix from euler angles, for conventions see makeRotate().*/
|
||||
inline static Matrix rotate( float heading, float pitch, float roll);
|
||||
inline static Matrix rotate( const Quat& quat);
|
||||
inline static Matrix inverse( const Matrix& matrix);
|
||||
|
||||
/** Create a orthographic projection. See glOrtho for further details.*/
|
||||
inline static Matrix ortho(const double left, const double right,
|
||||
@@ -277,6 +286,12 @@ inline Matrix Matrix::rotate(float angle, const Vec3& axis )
|
||||
m.makeRotate(angle,axis);
|
||||
return m;
|
||||
}
|
||||
inline Matrix Matrix::rotate(float heading, float pitch, float roll)
|
||||
{
|
||||
Matrix m;
|
||||
m.makeRotate(heading,pitch,roll);
|
||||
return m;
|
||||
}
|
||||
inline Matrix Matrix::rotate(const Vec3& from, const Vec3& to )
|
||||
{
|
||||
Matrix m;
|
||||
|
||||
Reference in New Issue
Block a user