minor refractoring

This commit is contained in:
Dander7BD 2014-02-11 09:32:49 +01:00
parent f53926444f
commit d5e85b4258
2 changed files with 11 additions and 11 deletions

View File

@ -88,9 +88,9 @@ const Quaternion & Camera_Basic::GetRotation() const
if( this->rotationIsOutOfDate )
{
// Maintain rotation resolution by keeping axis within [0, 2pi] (trigonometric methods gets faster too)
Float4 numerator;
::std::modf( this->angularAxis * (0.5f / pi), numerator.xyz );
this->angularAxis -= ((2.0f * pi) * numerator).xyz;
Float4 integer;
::std::modf( this->angularAxis * (0.5f / pi), integer.xyz );
this->angularAxis -= ((2.0f * pi) * integer).xyz;
this->rotation = Rotation( this->angularAxis );
this->rotationIsOutOfDate = false;

View File

@ -125,17 +125,17 @@ namespace std
}
/*******************************************************************
* @param numerator of the vector vec
* @return the denomiator of the vector vec.
* @param integer part of the elements in vector vec
* @return the fract part of the elements in vector vec.
*******************************************************************/
template<typename ScalarType>
inline ::LinearAlgebra::Vector3<ScalarType> modf( const ::LinearAlgebra::Vector3<ScalarType> &vec, ::LinearAlgebra::Vector3<ScalarType> &numerator )
inline ::LinearAlgebra::Vector3<ScalarType> modf( const ::LinearAlgebra::Vector3<ScalarType> &vec, ::LinearAlgebra::Vector3<ScalarType> &integer )
{
::LinearAlgebra::Vector3<ScalarType> denominator;
denominator.x = (ScalarType)modf( vec.x, &numerator.x );
denominator.y = (ScalarType)modf( vec.y, &numerator.y );
denominator.z = (ScalarType)modf( vec.z, &numerator.z );
return denominator;
::LinearAlgebra::Vector3<ScalarType> fract;
fract.x = (ScalarType)modf( vec.x, &integer.x );
fract.y = (ScalarType)modf( vec.y, &integer.y );
fract.z = (ScalarType)modf( vec.z, &integer.z );
return fract;
}
/*******************************************************************