Made the following name changes to Matrix and Quat to clean them up and make

the functionality clear given the name.  This will break user code unfortunately
so please be away of the following mapping.

  osg::Matrix::makeTrans(..)?\026 -> osg::Matrix::makeTranslate(..)
  osg::Matrix::makeRot(..)?\026   -> osg::Matrix::makeRotate(..)
  osg::Matrix::trans(..)?\026     -> osg::Matrix::translate(..)

  osg::Quat::makeRot(..)?\026     -> osg::Quat::makeRotate(..)

Also updated the rest of the OSG distribution to use the new names, and
have removed the old deprecated Matrix methods too.
This commit is contained in:
Robert Osfield
2001-12-12 20:29:10 +00:00
parent 79c1fb531d
commit f848c54ba3
21 changed files with 71 additions and 240 deletions

View File

@@ -15,7 +15,7 @@ using namespace osg;
/// Set the elements of the Quat to represent a rotation of angle
/// (radians) around the axis (x,y,z)
void Quat::makeRot( const float angle,
void Quat::makeRotate( const float angle,
const float x,
const float y,
const float z )
@@ -31,9 +31,9 @@ const float z )
}
void Quat::makeRot( const float angle, const Vec3& vec )
void Quat::makeRotate( const float angle, const Vec3& vec )
{
makeRot( angle, vec[0], vec[1], vec[2] );
makeRotate( angle, vec[0], vec[1], vec[2] );
}
@@ -42,7 +42,7 @@ void Quat::makeRot( const float angle, const Vec3& vec )
// and then use a cross product to get the rotation axis
// Watch out for the two special cases of when the vectors
// are co-incident or opposite in direction.
void Quat::makeRot( const Vec3& from, const Vec3& to )
void Quat::makeRotate( const Vec3& from, const Vec3& to )
{
const float epsilon = 0.00001f;
@@ -57,7 +57,7 @@ void Quat::makeRot( const Vec3& from, const Vec3& to )
// cosangle is close to 1, so the vectors are close to being coincident
// Need to generate an angle of zero with any vector we like
// We'll choose (1,0,0)
makeRot( 0.0, 1.0, 0.0, 0.0 );
makeRotate( 0.0, 1.0, 0.0, 0.0 );
}
else
if ( fabs(cosangle + 1.0) < epsilon )
@@ -87,7 +87,7 @@ void Quat::makeRot( const Vec3& from, const Vec3& to )
// and that is the axis around which to rotate.
Vec3 axis(from^to);
float angle = acos( cosangle );
makeRot( angle, axis );
makeRotate( angle, axis );
}
}