Math Functions
[Base FunctionsMath]

sqrt



OSG::Real32 OSG::osgSqrt (const OSG::Real32 rValue)
OSG::Real64 OSG::osgSqrt (const OSG::Real64 rValue)
OSG::Real128 OSG::osgSqrt (const OSG::Real128 rValue)
OSG::Fixed32 OSG::osgSqrt (const OSG::Fixed32 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgSqrt (const FloatTypeT rValue)

cos



OSG::Real32 OSG::osgCos (const OSG::Real32 rValue)
OSG::Real64 OSG::osgCos (const OSG::Real64 rValue)
OSG::Real128 OSG::osgCos (const OSG::Real128 rValue)
OSG::Fixed32 OSG::osgCos (const OSG::Fixed32 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgCos (const FloatTypeT rValue)

sin



OSG::Real32 OSG::osgSin (const OSG::Real32 rValue)
OSG::Real64 OSG::osgSin (const OSG::Real64 rValue)
OSG::Real128 OSG::osgSin (const OSG::Real128 rValue)
OSG::Fixed32 OSG::osgSin (const OSG::Fixed32 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgSin (const FloatTypeT rValue)

tan



OSG::Real32 OSG::osgTan (const OSG::Real32 rValue)
OSG::Real64 OSG::osgTan (const OSG::Real64 rValue)
OSG::Real128 OSG::osgTan (const OSG::Real128 rValue)
OSG::Fixed32 OSG::osgTan (const OSG::Fixed32 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgTan (const FloatTypeT rValue)

acos



OSG::Real32 OSG::osgACos (const OSG::Real32 rValue)
OSG::Real64 OSG::osgACos (const OSG::Real64 rValue)
OSG::Real128 OSG::osgACos (const OSG::Real128 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgACos (const FloatTypeT rValue)

asin



OSG::Real32 OSG::osgASin (const OSG::Real32 rValue)
OSG::Real64 OSG::osgASin (const OSG::Real64 rValue)
OSG::Real128 OSG::osgASin (const OSG::Real128 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgASin (const FloatTypeT rValue)

atan



OSG::Real32 OSG::osgATan (const OSG::Real32 rValue)
OSG::Real64 OSG::osgATan (const OSG::Real64 rValue)
OSG::Real128 OSG::osgATan (const OSG::Real128 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgATan (const FloatTypeT rValue)

atan2



OSG::Real32 OSG::osgATan2 (const OSG::Real32 rValue1, const OSG::Real32 rValue2)
OSG::Real64 OSG::osgATan2 (const OSG::Real64 rValue1, const OSG::Real64 rValue2)
OSG::Real128 OSG::osgATan2 (const OSG::Real128 rValue1, const OSG::Real128 rValue2)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgATan2 (const FloatTypeT rValue1, const FloatTypeT rValue2)

abs



OSG::Real32 OSG::osgAbs (const OSG::Real32 rValue)
OSG::Real64 OSG::osgAbs (const OSG::Real64 rValue)
OSG::Fixed32 OSG::osgAbs (const OSG::Fixed32 rValue)
OSG::Real128 OSG::osgAbs (const OSG::Real128 rValue)
template<class TypeT >
TypeT OSG::osgAbs (const TypeT rValue)

pow



OSG::Real32 OSG::osgPow (const OSG::Real32 rValue, const OSG::Real32 rExp)
OSG::Real64 OSG::osgPow (const OSG::Real64 rValue, const OSG::Real64 rExp)
OSG::Real128 OSG::osgPow (const OSG::Real128 rValue, const OSG::Real128 rExp)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgPow (const FloatTypeT rValue, const FloatTypeT rExp)

log



OSG::Real32 OSG::osgLog (const OSG::Real32 rValue)
OSG::Real64 OSG::osgLog (const OSG::Real64 rValue)
OSG::Real128 OSG::osgLog (const OSG::Real128 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgLog (const FloatTypeT rValue)

exp



OSG::Real32 OSG::osgExp (const OSG::Real32 rValue)
OSG::Real64 OSG::osgExp (const OSG::Real64 rValue)
OSG::Real128 OSG::osgExp (const OSG::Real128 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgExp (const FloatTypeT rValue)

floor



OSG::Real32 OSG::osgFloor (const OSG::Real32 rValue)
OSG::Real64 OSG::osgFloor (const OSG::Real64 rValue)
OSG::Real128 OSG::osgFloor (const OSG::Real128 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgFloor (const FloatTypeT rValue)

ceil



OSG::Real32 OSG::osgCeil (const OSG::Real32 rValue)
OSG::Real64 OSG::osgCeil (const OSG::Real64 rValue)
OSG::Real128 OSG::osgCeil (const OSG::Real128 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgCeil (const FloatTypeT rValue)

mod



template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgMod (const FloatTypeT lValue, const FloatTypeT rValue)
OSG::Real32 OSG::osgMod (const OSG::Real32 lValue, const OSG::Real32 rValue)
OSG::Real64 OSG::osgMod (const OSG::Real64 lValue, const OSG::Real64 rValue)

finite



template<class FloatTypeT >
OSG::UInt32 OSG::osgFinite (const FloatTypeT rValue)

min / max



template<class TypeT >
TypeT OSG::osgMin (const TypeT lValue, const TypeT rValue)
template<class TypeT >
TypeT OSG::osgMax (const TypeT lValue, const TypeT rValue)
template<class TypeT >
TypeT OSG::osgClamp (const TypeT minVal, const TypeT val, const TypeT maxVal)

sgn



template<class TypeT >
Int8 OSG::osgSgn (TypeT val)

swap



template<class TypeT >
void OSG::osgSwap (TypeT &lValue, TypeT &rValue)

degree2rad



OSG::Real32 OSG::osgDegree2Rad (const OSG::Real32 rValue)
OSG::Real64 OSG::osgDegree2Rad (const OSG::Real64 rValue)
OSG::Fixed32 OSG::osgDegree2Rad (const OSG::Fixed32 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgDegree2Rad (const FloatTypeT rValue)

rad2degree



OSG::Real32 OSG::osgRad2Degree (const OSG::Real32 rValue)
OSG::Real64 OSG::osgRad2Degree (const OSG::Real64 rValue)
OSG::Fixed32 OSG::osgRad2Degree (const OSG::Fixed32 rValue)
template<class FloatTypeT >
TypeTraits< FloatTypeT >
::RealReturnType 
OSG::osgRad2Degree (const FloatTypeT rValue)

ispower2



template<>
bool OSG::osgIsPower2< UInt32 > (const OSG::UInt32 rValue)
template<>
bool OSG::osgIsPower2< Int32 > (const OSG::Int32 rValue)
template<>
bool OSG::osgIsPower2< UInt64 > (const OSG::UInt64 rValue)
template<>
bool OSG::osgIsPower2< Int64 > (const OSG::Int64 rValue)

nextpower2



template<>
OSG::UInt32 OSG::osgNextPower2< UInt32 > (OSG::UInt32 rValue)
template<>
OSG::Int32 OSG::osgNextPower2< Int32 > (OSG::Int32 rValue)
template<>
OSG::UInt64 OSG::osgNextPower2< UInt64 > (OSG::UInt64 rValue)
template<>
OSG::Int64 OSG::osgNextPower2< Int64 > (OSG::Int64 rValue)

Detailed Description

ToDo


Function Documentation

OSG::Real32 OSG::osgSqrt ( const OSG::Real32  rValue  )  [inline]

Return the square root of the argument, i.e. the number y that satisfies y2 == rValue. The argument must be nonnegative.

Parameters:
[in] rValue The number to compute the square root of, must be >= 0.
Returns:
The square root of the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 79 of file OSGBaseFunctions.inl.

00080 {
00081 #ifdef OSG_USE_STDMATH
00082     return std::sqrt(rValue);
00083 #elif defined(OSG_HAS_FLOATMATH)
00084     return sqrtf(rValue);
00085 #else
00086     return static_cast<Real32>(sqrt(static_cast<Real32>(rValue)));
00087 #endif
00088 }

OSG::Real64 OSG::osgSqrt ( const OSG::Real64  rValue  )  [inline]

Return the square root of the argument, i.e. the number y that satisfies y2 == rValue. The argument must be nonnegative.

Parameters:
[in] rValue The number to compute the square root of, must be >= 0.
Returns:
The square root of the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 93 of file OSGBaseFunctions.inl.

00094 {
00095 #ifdef OSG_USE_STDMATH
00096     return std::sqrt(rValue);
00097 #else
00098     return sqrt(rValue);
00099 #endif
00100 }

OSG::Real128 OSG::osgSqrt ( const OSG::Real128  rValue  )  [inline]

Return the square root of the argument, i.e. the number y that satisfies y2 == rValue. The argument must be nonnegative.

Parameters:
[in] rValue The number to compute the square root of, must be >= 0.
Returns:
The square root of the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 105 of file OSGBaseFunctions.inl.

00106 {
00107 #ifdef OSG_USE_STDMATH
00108     return std::sqrt(rValue);
00109 #else
00110     return sqrtl(rValue);
00111 #endif
00112 }

OSG::Fixed32 OSG::osgSqrt ( const OSG::Fixed32  rValue  )  [inline]

Return the square root of the argument, i.e. the number y that satisfies y2 == rValue. The argument must be nonnegative.

Parameters:
[in] rValue The number to compute the square root of, must be >= 0.
Returns:
The square root of the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 118 of file OSGBaseFunctions.inl.

00119 {
00120     return Fixed32::sqrt(rValue);
00121 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgSqrt ( const FloatTypeT  rValue  )  [inline]

Return the square root of the argument, i.e. the number y that satisfies y2 == rValue. The argument must be nonnegative.

Parameters:
[in] rValue The number to compute the square root of, must be >= 0.
Returns:
The square root of the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 128 of file OSGBaseFunctions.inl.

Referenced by OSG::ShaderShadowMapEngine::calcPointLightRange(), OSG::TrapezoidalShadowMapEngine::calcTrapezoidalTransform(), OSG::Point< ValueTypeT, SizeI >::dist(), OSG::TransformationMatrix< ValueTypeT >::factor(), OSG::FishEyeProjector::flattenVertex(), OSG::Surface::getDesiredError(), OSG::FishEyeProjector::initBottomMesh(), OSG::GroupMCastConnection::initialize(), OSG::FishEyeProjector::initLeftMesh(), OSG::FishEyeProjector::initRightMesh(), OSG::FishEyeProjector::initTopMesh(), OSG::Line::intersect(), OSG::TransformationMatrix< ValueTypeT >::jacobi(), OSG::Vector< ValueTypeT, SizeI >::length(), OSG::QuaternionBase< ValueTypeT >::length(), OSG::TransformationMatrix< ValueTypeT >::norm2(), OSG::TransformationMatrix< ValueTypeT >::polarDecompose(), OSG::FrustumVolume::setPlanes(), OSG::QuaternionBase< ValueTypeT >::setValue(), OSG::QuaternionBase< ValueTypeT >::setValueAsAxisRad(), OSG::TransformationMatrix< ValueTypeT >::spectralDecompose(), OSG::TileGeometryLoad::TileGeometryLoad(), and OSG::TileGeometryLoad::updateGeometry().

00129 {
00130     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00131
00132     return  osgSqrt(RealType(rValue));
00133 }

OSG::Real32 OSG::osgCos ( const OSG::Real32  rValue  )  [inline]

Return the cosine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the cosine of.
Returns:
Cosine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 220 of file OSGBaseFunctions.inl.

00221 {
00222 #ifdef OSG_USE_STDMATH
00223     return std::cos(rValue);
00224 #elif defined(OSG_HAS_FLOATMATH)
00225     return cosf(rValue);
00226 #else
00227     return static_cast<Real32>(cos(static_cast<Real32>(rValue)));
00228 #endif
00229 }

OSG::Real64 OSG::osgCos ( const OSG::Real64  rValue  )  [inline]

Return the cosine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the cosine of.
Returns:
Cosine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 234 of file OSGBaseFunctions.inl.

00235 {
00236 #ifdef OSG_USE_STDMATH
00237     return std::cos(rValue);
00238 #else
00239     return cos(rValue);
00240 #endif
00241 }

OSG::Real128 OSG::osgCos ( const OSG::Real128  rValue  )  [inline]

Return the cosine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the cosine of.
Returns:
Cosine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 246 of file OSGBaseFunctions.inl.

00247 {
00248 #ifdef OSG_USE_STDMATH
00249     return std::cos(rValue);
00250 #else
00251     return cosl(rValue);
00252 #endif
00253 }

OSG::Fixed32 OSG::osgCos ( const OSG::Fixed32  rValue  )  [inline]

Return the cosine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the cosine of.
Returns:
Cosine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 258 of file OSGBaseFunctions.inl.

00259 {
00260     return Fixed32::cos(rValue);
00261 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgCos ( const FloatTypeT  rValue  )  [inline]

Return the cosine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the cosine of.
Returns:
Cosine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 268 of file OSGBaseFunctions.inl.

Referenced by OSG::SkyBackground::clear(), OSG::FishEyeProjector::flattenVertex(), OSG::quatFromEul(), OSG::QuaternionBase< ValueTypeT >::setValue(), and OSG::QuaternionBase< ValueTypeT >::setValueAsAxisRad().

00269 {
00270     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00271
00272     return  osgCos(RealType(rValue));
00273 }

OSG::Real32 OSG::osgSin ( const OSG::Real32  rValue  )  [inline]

Return the sine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the sine of.
Returns:
Sine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 359 of file OSGBaseFunctions.inl.

00360 {
00361 #ifdef OSG_USE_STDMATH
00362     return std::sin(rValue);
00363 #elif defined(OSG_HAS_FLOATMATH)
00364     return sinf(rValue);
00365 #else
00366     return static_cast<Real32>(sin(static_cast<Real32>(rValue)));
00367 #endif
00368 }

OSG::Real64 OSG::osgSin ( const OSG::Real64  rValue  )  [inline]

Return the sine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the sine of.
Returns:
Sine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 373 of file OSGBaseFunctions.inl.

00374 {
00375 #ifdef OSG_USE_STDMATH
00376     return std::sin(rValue);
00377 #else
00378     return sin(rValue);
00379 #endif
00380 }

OSG::Real128 OSG::osgSin ( const OSG::Real128  rValue  )  [inline]

Return the sine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the sine of.
Returns:
Sine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 385 of file OSGBaseFunctions.inl.

00386 {
00387 #ifdef OSG_USE_STDMATH
00388     return std::sin(rValue);
00389 #else
00390     return sinl(rValue);
00391 #endif
00392 }

OSG::Fixed32 OSG::osgSin ( const OSG::Fixed32  rValue  )  [inline]

Return the sine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the sine of.
Returns:
Sine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 397 of file OSGBaseFunctions.inl.

00398 {
00399     return Fixed32::sin(rValue);
00400 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgSin ( const FloatTypeT  rValue  )  [inline]

Return the sine of the argument, which is given in radians.

Parameters:
[in] rValue The angle in radians to compute the sine of.
Returns:
Sine of rValue, it is in the range -1 to 1.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 407 of file OSGBaseFunctions.inl.

Referenced by OSG::SkyBackground::clear(), OSG::FishEyeProjector::flattenVertex(), OSG::quatFromEul(), OSG::QuaternionBase< ValueTypeT >::setValue(), OSG::QuaternionBase< ValueTypeT >::setValueAsAxisRad(), and OSG::QuaternionBase< ValueTypeT >::slerp().

00408 {
00409     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00410
00411     return  osgSin(RealType(rValue));
00412 }

OSG::Real32 OSG::osgTan ( const OSG::Real32  rValue  )  [inline]

Return the tangent of the argument, which is given in radians. The tangent is defined as tan(x) = sin(x) / cos(x) and therefore has singularities at odd multiples of pi/2.

Parameters:
[in] rValue The angle in radians to compute the tangent of.
Returns:
Tangent of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 500 of file OSGBaseFunctions.inl.

00501 {
00502 #ifdef OSG_USE_STDMATH
00503     return std::tan(rValue);
00504 #elif defined(OSG_HAS_FLOATMATH)
00505     return tanf(rValue);
00506 #else
00507     return static_cast<Real32>(tan(static_cast<Real32>(rValue)));
00508 #endif
00509 }

OSG::Real64 OSG::osgTan ( const OSG::Real64  rValue  )  [inline]

Return the tangent of the argument, which is given in radians. The tangent is defined as tan(x) = sin(x) / cos(x) and therefore has singularities at odd multiples of pi/2.

Parameters:
[in] rValue The angle in radians to compute the tangent of.
Returns:
Tangent of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 514 of file OSGBaseFunctions.inl.

00515 {
00516 #ifdef OSG_USE_STDMATH
00517     return std::tan(rValue);
00518 #else
00519     return tan(rValue);
00520 #endif
00521 }

OSG::Real128 OSG::osgTan ( const OSG::Real128  rValue  )  [inline]

Return the tangent of the argument, which is given in radians. The tangent is defined as tan(x) = sin(x) / cos(x) and therefore has singularities at odd multiples of pi/2.

Parameters:
[in] rValue The angle in radians to compute the tangent of.
Returns:
Tangent of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 526 of file OSGBaseFunctions.inl.

00527 {
00528 #ifdef OSG_USE_STDMATH
00529     return std::tan(rValue);
00530 #else
00531     return tanl(rValue);
00532 #endif
00533 }

OSG::Fixed32 OSG::osgTan ( const OSG::Fixed32  rValue  )  [inline]

Return the tangent of the argument, which is given in radians. The tangent is defined as tan(x) = sin(x) / cos(x) and therefore has singularities at odd multiples of pi/2.

Parameters:
[in] rValue The angle in radians to compute the tangent of.
Returns:
Tangent of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 538 of file OSGBaseFunctions.inl.

00539 {
00540     return Fixed32::tan(rValue);
00541 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgTan ( const FloatTypeT  rValue  )  [inline]

Return the tangent of the argument, which is given in radians. The tangent is defined as tan(x) = sin(x) / cos(x) and therefore has singularities at odd multiples of pi/2.

Parameters:
[in] rValue The angle in radians to compute the tangent of.
Returns:
Tangent of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 548 of file OSGBaseFunctions.inl.

Referenced by OSG::TrapezoidalShadowMapEngine::calcTrapezoidalTransform(), OSG::OffCenterPerspectiveCamera::getProjection(), OSG::PerspectiveCamera::getProjection(), OSG::BalancedMultiWindow::preloadCache(), and OSG::SimpleSceneManager::showAll().

00549 {
00550     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00551
00552     return  osgTan(RealType(rValue));
00553 }

OSG::Real32 OSG::osgACos ( const OSG::Real32  rValue  )  [inline]

Return the arc cosine (in radians) of the argument, i.e. the number y such that rValue == cos(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc cosine of, must be in the range [-1; 1].
Returns:
The arc cosine of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 643 of file OSGBaseFunctions.inl.

00644 {
00645 #ifdef OSG_USE_STDMATH
00646     return std::acos(rValue);
00647 #elif defined(OSG_HAS_FLOATMATH)
00648     return acosf(rValue);
00649 #else
00650     return static_cast<Real32>(acos(static_cast<Real32>(rValue)));
00651 #endif
00652 }

OSG::Real64 OSG::osgACos ( const OSG::Real64  rValue  )  [inline]

Return the arc cosine (in radians) of the argument, i.e. the number y such that rValue == cos(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc cosine of, must be in the range [-1; 1].
Returns:
The arc cosine of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 657 of file OSGBaseFunctions.inl.

00658 {
00659 #ifdef OSG_USE_STDMATH
00660     return std::acos(rValue);
00661 #else
00662     return acos(rValue);
00663 #endif
00664 }

OSG::Real128 OSG::osgACos ( const OSG::Real128  rValue  )  [inline]

Return the arc cosine (in radians) of the argument, i.e. the number y such that rValue == cos(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc cosine of, must be in the range [-1; 1].
Returns:
The arc cosine of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 669 of file OSGBaseFunctions.inl.

00670 {
00671 #ifdef OSG_USE_STDMATH
00672     return std::acos(rValue);
00673 #else
00674     return acosl(rValue);
00675 #endif
00676 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgACos ( const FloatTypeT  rValue  )  [inline]

Return the arc cosine (in radians) of the argument, i.e. the number y such that rValue == cos(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc cosine of, must be in the range [-1; 1].
Returns:
The arc cosine of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 683 of file OSGBaseFunctions.inl.

Referenced by OSG::addPoint(), OSG::TrapezoidalShadowMapEngine::calcTrapezoidalTransform(), OSG::Vector< ValueTypeT, SizeI >::enclosedAngle(), OSG::TextVectorGlyph::getNormals(), OSG::QuaternionBase< ValueTypeT >::getValueAsAxisDeg(), and OSG::QuaternionBase< ValueTypeT >::slerp().

00684 {
00685     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00686
00687     return  osgACos(RealType(rValue));
00688 }

OSG::Real32 OSG::osgASin ( const OSG::Real32  rValue  )  [inline]

Return the arc sine (in radians) of the argument, i.e. the number y such that rValue == sin(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc sine of, must be in the range [-1; 1].
Returns:
The arc sine of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 770 of file OSGBaseFunctions.inl.

00771 {
00772 #ifdef OSG_USE_STDMATH
00773     return std::asin(rValue);
00774 #elif defined(OSG_HAS_FLOATMATH)
00775     return asinf(rValue);
00776 #else
00777     return static_cast<Real32>(asin(static_cast<Real32>(rValue)));
00778 #endif
00779 }

OSG::Real64 OSG::osgASin ( const OSG::Real64  rValue  )  [inline]

Return the arc sine (in radians) of the argument, i.e. the number y such that rValue == sin(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc sine of, must be in the range [-1; 1].
Returns:
The arc sine of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 785 of file OSGBaseFunctions.inl.

00786 {
00787 #ifdef OSG_USE_STDMATH
00788     return std::asin(rValue);
00789 #else
00790     return asin(rValue);
00791 #endif
00792 }

OSG::Real128 OSG::osgASin ( const OSG::Real128  rValue  )  [inline]

Return the arc sine (in radians) of the argument, i.e. the number y such that rValue == sin(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc sine of, must be in the range [-1; 1].
Returns:
The arc sine of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 797 of file OSGBaseFunctions.inl.

00798 {
00799 #ifdef OSG_USE_STDMATH
00800     return std::asin(rValue);
00801 #else
00802     return asinl(rValue);
00803 #endif
00804 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgASin ( const FloatTypeT  rValue  )  [inline]

Return the arc sine (in radians) of the argument, i.e. the number y such that rValue == sin(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc sine of, must be in the range [-1; 1].
Returns:
The arc sine of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 811 of file OSGBaseFunctions.inl.

Referenced by OSG::TrackballEngine::rotate(), and OSG::Trackball::updateRotation().

00812 {
00813     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00814
00815     return  osgASin(RealType(rValue));
00816 }

OSG::Real32 OSG::osgATan ( const OSG::Real32  rValue  )  [inline]

Return the arc tangent (in radians) of the argument, i.e. the number y such that rValue == tan(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc tangent of.
Returns:
The arc tangent of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.
See also:
osgATan2(const FloatTypeT,const FloatTypeT)

Definition at line 900 of file OSGBaseFunctions.inl.

00901 {
00902 #ifdef OSG_USE_STDMATH
00903     return std::atan(rValue);
00904 #elif defined(OSG_HAS_FLOATMATH)
00905     return atanf(rValue);
00906 #else
00907     return static_cast<Real32>(atan(static_cast<Real32>(rValue)));
00908 #endif
00909 }

OSG::Real64 OSG::osgATan ( const OSG::Real64  rValue  )  [inline]

Return the arc tangent (in radians) of the argument, i.e. the number y such that rValue == tan(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc tangent of.
Returns:
The arc tangent of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.
See also:
osgATan2(const FloatTypeT,const FloatTypeT)

Definition at line 914 of file OSGBaseFunctions.inl.

00915 {
00916 #ifdef OSG_USE_STDMATH
00917     return std::atan(rValue);
00918 #else
00919     return atan(rValue);
00920 #endif
00921 }

OSG::Real128 OSG::osgATan ( const OSG::Real128  rValue  )  [inline]

Return the arc tangent (in radians) of the argument, i.e. the number y such that rValue == tan(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc tangent of.
Returns:
The arc tangent of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.
See also:
osgATan2(const FloatTypeT,const FloatTypeT)

Definition at line 926 of file OSGBaseFunctions.inl.

00927 {
00928 #ifdef OSG_USE_STDMATH
00929     return std::atan(rValue);
00930 #else
00931     return atanl(rValue);
00932 #endif
00933 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgATan ( const FloatTypeT  rValue  )  [inline]

Return the arc tangent (in radians) of the argument, i.e. the number y such that rValue == tan(y) and y is in the range [-pi/2; pi/2].

Parameters:
[in] rValue The number to compute the arc tangent of.
Returns:
The arc tangent of rValue in the range [-pi/2; pi/2].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.
See also:
osgATan2(const FloatTypeT,const FloatTypeT)

Definition at line 940 of file OSGBaseFunctions.inl.

Referenced by OSG::SimplePolygon::getAngle().

00941 {
00942     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00943
00944     return  osgATan(RealType(rValue));
00945 }

OSG::Real32 OSG::osgATan2 ( const OSG::Real32  rValue1,
const OSG::Real32  rValue2 
) [inline]

Return the arc tangent (in radians) of rValue1 / rValue2 using the signs of both arguments to determine the quadrant. This can be used to obtain the angle component of the polar coordinates of a point with cartesian coordinates (rValue2, rValue1).

Parameters:
[in] rValue1 The numerator of the value to compute atan of.
[in] rValue2 The denominator of the value to compute atan of.
Returns:
The arc tangent of rValue1 / rValue2 in the range [-pi; pi].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1032 of file OSGBaseFunctions.inl.

01033 {
01034 #ifdef OSG_USE_STDMATH
01035     return std::atan2(rValue1, rValue2);
01036 #elif defined(OSG_HAS_FLOATMATH)
01037 #ifndef _OSG_HAS_ATANF2__
01038     return atan2f(rValue1, rValue2);
01039 #else
01040     return static_cast<Real32>(atan2(static_cast<Real32>(rValue1),
01041                                      static_cast<Real32>(rValue2) ));
01042 #endif
01043 #else
01044     return static_cast<Real32>(atan2(static_cast<Real32>(rValue1),
01045                                      static_cast<Real32>(rValue2) ));
01046 #endif
01047 }

OSG::Real64 OSG::osgATan2 ( const OSG::Real64  rValue1,
const OSG::Real64  rValue2 
) [inline]

Return the arc tangent (in radians) of rValue1 / rValue2 using the signs of both arguments to determine the quadrant. This can be used to obtain the angle component of the polar coordinates of a point with cartesian coordinates (rValue2, rValue1).

Parameters:
[in] rValue1 The numerator of the value to compute atan of.
[in] rValue2 The denominator of the value to compute atan of.
Returns:
The arc tangent of rValue1 / rValue2 in the range [-pi; pi].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1052 of file OSGBaseFunctions.inl.

01053 {
01054 #ifdef OSG_USE_STDMATH
01055     return std::atan2(rValue1, rValue2);
01056 #else
01057     return atan2(rValue1, rValue2);
01058 #endif
01059 }

OSG::Real128 OSG::osgATan2 ( const OSG::Real128  rValue1,
const OSG::Real128  rValue2 
) [inline]

Return the arc tangent (in radians) of rValue1 / rValue2 using the signs of both arguments to determine the quadrant. This can be used to obtain the angle component of the polar coordinates of a point with cartesian coordinates (rValue2, rValue1).

Parameters:
[in] rValue1 The numerator of the value to compute atan of.
[in] rValue2 The denominator of the value to compute atan of.
Returns:
The arc tangent of rValue1 / rValue2 in the range [-pi; pi].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1064 of file OSGBaseFunctions.inl.

01065 {
01066 #ifdef OSG_USE_STDMATH
01067     return std::atan2(rValue1, rValue2);
01068 #else
01069     return atan2l(rValue1, rValue2);
01070 #endif
01071 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgATan2 ( const FloatTypeT  rValue1,
const FloatTypeT  rValue2 
) [inline]

Return the arc tangent (in radians) of rValue1 / rValue2 using the signs of both arguments to determine the quadrant. This can be used to obtain the angle component of the polar coordinates of a point with cartesian coordinates (rValue2, rValue1).

Parameters:
[in] rValue1 The numerator of the value to compute atan of.
[in] rValue2 The denominator of the value to compute atan of.
Returns:
The arc tangent of rValue1 / rValue2 in the range [-pi; pi].
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1078 of file OSGBaseFunctions.inl.

Referenced by OSG::calcTexS().

01080 {
01081     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
01082
01083     return  osgATan2(RealType(rValue1), RealType(rValue2));
01084 }

OSG::Real32 OSG::osgAbs ( const OSG::Real32  rValue  )  [inline]

Return the absolute value of the argument.

Parameters:
[in] rValue Number to compute absolute value of.
Returns:
Absolute value of rValue.
Note:
For floating point arguments this function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1166 of file OSGBaseFunctions.inl.

01167 {
01168 #ifdef OSG_USE_STDMATH
01169     return std::abs(rValue);
01170 #elif defined(OSG_HAS_FLOATMATH) && !defined(OSG_NO_FABSF)
01171     return fabsf(rValue);
01172 #else
01173     return static_cast<Real32>(fabs(static_cast<Real32>(rValue)));
01174 #endif
01175 }

OSG::Real64 OSG::osgAbs ( const OSG::Real64  rValue  )  [inline]

Return the absolute value of the argument.

Parameters:
[in] rValue Number to compute absolute value of.
Returns:
Absolute value of rValue.
Note:
For floating point arguments this function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1180 of file OSGBaseFunctions.inl.

01181 {
01182 #ifdef OSG_USE_STDMATH
01183     return std::abs(rValue);
01184 #else
01185     return fabs(rValue);
01186 #endif
01187 }

OSG::Fixed32 OSG::osgAbs ( const OSG::Fixed32  rValue  )  [inline]

Return the absolute value of the argument.

Parameters:
[in] rValue Number to compute absolute value of.
Returns:
Absolute value of rValue.
Note:
For floating point arguments this function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1192 of file OSGBaseFunctions.inl.

01193 {
01194     return Fixed32::abs(rValue);
01195 }

OSG::Real128 OSG::osgAbs ( const OSG::Real128  rValue  )  [inline]

Return the absolute value of the argument.

Parameters:
[in] rValue Number to compute absolute value of.
Returns:
Absolute value of rValue.
Note:
For floating point arguments this function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1200 of file OSGBaseFunctions.inl.

01201 {
01202 #ifdef OSG_USE_STDMATH
01203     return std::abs(rValue);
01204 #else
01205     return fabsl(rValue);
01206 #endif
01207 }

template<class TypeT >
TypeT OSG::osgAbs ( const TypeT  rValue  )  [inline]

Return the absolute value of the argument.

Parameters:
[in] rValue Number to compute absolute value of.
Returns:
Absolute value of rValue.
Note:
For floating point arguments this function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1213 of file OSGBaseFunctions.inl.

01214 {
01215     return (rValue > 0) ? rValue : -rValue;
01216 }

OSG::Real32 OSG::osgPow ( const OSG::Real32  rValue,
const OSG::Real32  rExp 
) [inline]

Return rValue to the power of rExp.

Parameters:
[in] rValue Base.
[in] rExp Exponent.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1303 of file OSGBaseFunctions.inl.

01304 {
01305 #ifdef OSG_USE_STDMATH
01306     return std::pow(rValue, rExp);
01307 #elif defined(OSG_HAS_FLOATMATH)
01308     return powf(rValue, rExp);
01309 #else
01310     return static_cast<Real32>(pow(static_cast<Real32>(rValue),
01311                                    static_cast<Real32>(rExp)   ));
01312 #endif
01313 }

OSG::Real64 OSG::osgPow ( const OSG::Real64  rValue,
const OSG::Real64  rExp 
) [inline]

Return rValue to the power of rExp.

Parameters:
[in] rValue Base.
[in] rExp Exponent.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1318 of file OSGBaseFunctions.inl.

01319 {
01320 #ifdef OSG_USE_STDMATH
01321     return std::pow(rValue, rExp);
01322 #else
01323     return pow(rValue, rExp);
01324 #endif
01325 }

OSG::Real128 OSG::osgPow ( const OSG::Real128  rValue,
const OSG::Real128  rExp 
) [inline]

Return rValue to the power of rExp.

Parameters:
[in] rValue Base.
[in] rExp Exponent.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1330 of file OSGBaseFunctions.inl.

01331 {
01332 #ifdef OSG_USE_STDMATH
01333     return std::pow(rValue, rExp);
01334 #else
01335     return powl(rValue, rExp);
01336 #endif
01337 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgPow ( const FloatTypeT  rValue,
const FloatTypeT  rExp 
) [inline]

Return rValue to the power of rExp.

Parameters:
[in] rValue Base.
[in] rExp Exponent.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1344 of file OSGBaseFunctions.inl.

Referenced by OSG::TrackballEngine::moveTo(), OSG::TransformationMatrix< ValueTypeT >::sqrt(), and OSG::TransformationMatrix< ValueTypeT >::sqrtOf().

01346 {
01347     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
01348
01349     return  osgPow(RealType(rValue), RealType(rExp));
01350 }

OSG::Real32 OSG::osgLog ( const OSG::Real32  rValue  )  [inline]

Return the natural logarithm of the argument, i.e. the number y such that ey == rValue, where e is Euler's number.

Parameters:
[in] rValue The number to compute the natural logarithm of, must be >= 0.
Returns:
Natural logarithm of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1431 of file OSGBaseFunctions.inl.

01432 {
01433 #ifdef OSG_USE_STDMATH
01434     return std::log(rValue);
01435 #elif defined(OSG_HAS_FLOATMATH)
01436     return logf(rValue);
01437 #else
01438     return static_cast<Real32>(log(static_cast<Real32>(rValue)));
01439 #endif
01440 }

OSG::Real64 OSG::osgLog ( const OSG::Real64  rValue  )  [inline]

Return the natural logarithm of the argument, i.e. the number y such that ey == rValue, where e is Euler's number.

Parameters:
[in] rValue The number to compute the natural logarithm of, must be >= 0.
Returns:
Natural logarithm of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1445 of file OSGBaseFunctions.inl.

01446 {
01447 #ifdef OSG_USE_STDMATH
01448     return std::log(rValue);
01449 #else
01450     return log(rValue);
01451 #endif
01452 }

OSG::Real128 OSG::osgLog ( const OSG::Real128  rValue  )  [inline]

Return the natural logarithm of the argument, i.e. the number y such that ey == rValue, where e is Euler's number.

Parameters:
[in] rValue The number to compute the natural logarithm of, must be >= 0.
Returns:
Natural logarithm of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1457 of file OSGBaseFunctions.inl.

01458 {
01459 #ifdef OSG_USE_STDMATH
01460     return std::log(rValue);
01461 #else
01462     return logl(rValue);
01463 #endif
01464 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgLog ( const FloatTypeT  rValue  )  [inline]

Return the natural logarithm of the argument, i.e. the number y such that ey == rValue, where e is Euler's number.

Parameters:
[in] rValue The number to compute the natural logarithm of, must be >= 0.
Returns:
Natural logarithm of rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1471 of file OSGBaseFunctions.inl.

Referenced by OSG::QuadTreeTerrain::changed(), OSG::TransformationMatrix< ValueTypeT >::exp(), OSG::TransformationMatrix< ValueTypeT >::expOf(), OSG::SceneFileType::print(), OSG::Log::setHeaderElem(), OSG::Log::setLogFile(), OSG::Log::setLogLevel(), and OSG::Log::setLogType().

01472 {
01473     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
01474
01475     return  osgLog(RealType(rValue));
01476 }

OSG::Real32 OSG::osgExp ( const OSG::Real32  rValue  )  [inline]

Return e to the power rValue, where e is Euler's number, the base of the natural logarithm.

Parameters:
[in] rValue Exponent.
Returns:
e to the power rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1557 of file OSGBaseFunctions.inl.

01558 {
01559 #ifdef OSG_USE_STDMATH
01560     return std::exp(rValue);
01561 #elif defined(OSG_HAS_FLOATMATH)
01562     return expf(rValue);
01563 #else
01564     return static_cast<Real32>(exp(static_cast<Real32>(rValue)));
01565 #endif
01566 }

OSG::Real64 OSG::osgExp ( const OSG::Real64  rValue  )  [inline]

Return e to the power rValue, where e is Euler's number, the base of the natural logarithm.

Parameters:
[in] rValue Exponent.
Returns:
e to the power rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1571 of file OSGBaseFunctions.inl.

01572 {
01573 #ifdef OSG_USE_STDMATH
01574     return std::exp(rValue);
01575 #else
01576     return exp(rValue);
01577 #endif
01578 }

OSG::Real128 OSG::osgExp ( const OSG::Real128  rValue  )  [inline]

Return e to the power rValue, where e is Euler's number, the base of the natural logarithm.

Parameters:
[in] rValue Exponent.
Returns:
e to the power rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1583 of file OSGBaseFunctions.inl.

01584 {
01585 #ifdef OSG_USE_STDMATH
01586     return std::exp(rValue);
01587 #else
01588     return expl(rValue);
01589 #endif
01590 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgExp ( const FloatTypeT  rValue  )  [inline]

Return e to the power rValue, where e is Euler's number, the base of the natural logarithm.

Parameters:
[in] rValue Exponent.
Returns:
e to the power rValue.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1597 of file OSGBaseFunctions.inl.

01598 {
01599     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
01600
01601     return  osgExp(RealType(rValue));
01602 }

OSG::Real32 OSG::osgFloor ( const OSG::Real32  rValue  )  [inline]

Returns the argument rounded downwards to the nearest integer, i.e. returns the largest integer not greater than rValue.

Example:

    osgFloor( 1.5) ==  1.0;
    osgFloor(-1.5) == -2.0;
Parameters:
[in] rValue Number to round down.
Returns:
Largest integer not greater than the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1688 of file OSGBaseFunctions.inl.

01689 {
01690 #ifdef OSG_USE_STDMATH
01691     return std::floor(rValue);
01692 #elif defined(OSG_HAS_FLOATMATH)
01693 # ifdef OSG_HPUX_ACC
01694     return static_cast<Real32>(floor(static_cast<Real32>(rValue)));
01695 # else
01696     return floorf(rValue);
01697 # endif
01698 #else
01699     return static_cast<Real32>(floor(static_cast<Real32>(rValue)));
01700 #endif
01701 }

OSG::Real64 OSG::osgFloor ( const OSG::Real64  rValue  )  [inline]

Returns the argument rounded downwards to the nearest integer, i.e. returns the largest integer not greater than rValue.

Example:

    osgFloor( 1.5) ==  1.0;
    osgFloor(-1.5) == -2.0;
Parameters:
[in] rValue Number to round down.
Returns:
Largest integer not greater than the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1706 of file OSGBaseFunctions.inl.

01707 {
01708 #ifdef OSG_USE_STDMATH
01709     return std::floor(rValue);
01710 #else
01711     return floor(rValue);
01712 #endif
01713 }

OSG::Real128 OSG::osgFloor ( const OSG::Real128  rValue  )  [inline]

Returns the argument rounded downwards to the nearest integer, i.e. returns the largest integer not greater than rValue.

Example:

    osgFloor( 1.5) ==  1.0;
    osgFloor(-1.5) == -2.0;
Parameters:
[in] rValue Number to round down.
Returns:
Largest integer not greater than the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1718 of file OSGBaseFunctions.inl.

01719 {
01720 #ifdef OSG_USE_STDMATH
01721     return std::floor(rValue);
01722 #else
01723     return floorl(rValue);
01724 #endif
01725 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgFloor ( const FloatTypeT  rValue  )  [inline]

Returns the argument rounded downwards to the nearest integer, i.e. returns the largest integer not greater than rValue.

Example:

    osgFloor( 1.5) ==  1.0;
    osgFloor(-1.5) == -2.0;
Parameters:
[in] rValue Number to round down.
Returns:
Largest integer not greater than the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1732 of file OSGBaseFunctions.inl.

01733 {
01734     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
01735
01736     return  osgFloor(RealType(rValue));
01737 }

OSG::Real32 OSG::osgCeil ( const OSG::Real32  rValue  )  [inline]

Returns the argument rounded upwards to the nearest integer, i.e. returns the smallest integer not less than rValue.

Example:

    osgCeil( 1.5) ==  2.0;
    osgCeil(-1.5) == -1.0;
Parameters:
[in] rValue Number to round up.
Returns:
Smallest integer not less than the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1829 of file OSGBaseFunctions.inl.

01830 {
01831 #ifdef OSG_USE_STDMATH
01832     return std::ceil(rValue);
01833 #elif defined(OSG_HAS_FLOATMATH)
01834 # ifdef OSG_HPUX_ACC
01835     return static_cast<Real32>(ceil(static_cast<Real32>(rValue)));
01836 # else
01837     return ceilf(rValue);
01838 # endif
01839 #else
01840     return static_cast<Real32>(ceil(static_cast<Real32>(rValue)));
01841 #endif
01842 }

OSG::Real64 OSG::osgCeil ( const OSG::Real64  rValue  )  [inline]

Returns the argument rounded upwards to the nearest integer, i.e. returns the smallest integer not less than rValue.

Example:

    osgCeil( 1.5) ==  2.0;
    osgCeil(-1.5) == -1.0;
Parameters:
[in] rValue Number to round up.
Returns:
Smallest integer not less than the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1847 of file OSGBaseFunctions.inl.

01848 {
01849 #ifdef OSG_USE_STDMATH
01850     return std::ceil(rValue);
01851 #else
01852     return ceil(rValue);
01853 #endif
01854 }

OSG::Real128 OSG::osgCeil ( const OSG::Real128  rValue  )  [inline]

Returns the argument rounded upwards to the nearest integer, i.e. returns the smallest integer not less than rValue.

Example:

    osgCeil( 1.5) ==  2.0;
    osgCeil(-1.5) == -1.0;
Parameters:
[in] rValue Number to round up.
Returns:
Smallest integer not less than the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1859 of file OSGBaseFunctions.inl.

01860 {
01861 #ifdef OSG_USE_STDMATH
01862     return std::ceil(rValue);
01863 #else
01864     return ceill(rValue);
01865 #endif
01866 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgCeil ( const FloatTypeT  rValue  )  [inline]

Returns the argument rounded upwards to the nearest integer, i.e. returns the smallest integer not less than rValue.

Example:

    osgCeil( 1.5) ==  2.0;
    osgCeil(-1.5) == -1.0;
Parameters:
[in] rValue Number to round up.
Returns:
Smallest integer not less than the argument.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1873 of file OSGBaseFunctions.inl.

Referenced by OSG::OcclusionCullingTreeBuilder::add(), and OSG::TextPixmapFace::makeImage().

01874 {
01875     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
01876
01877     return  OSG::osgCeil(RealType(rValue));
01878 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgMod ( const FloatTypeT  lValue,
const FloatTypeT  rValue 
) [inline]
Parameters:
[in] lValue 
[in] rValue 
Returns:
lValue % rValue
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1951 of file OSGBaseFunctions.inl.

01952 {
01953     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
01954
01955     return  OSG::osgMod(RealType(lValue), RealType(rValue));
01956 }

OSG::Real32 OSG::osgMod ( const OSG::Real32  lValue,
const OSG::Real32  rValue 
) [inline]
Parameters:
[in] lValue 
[in] rValue 
Returns:
lValue % rValue
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1961 of file OSGBaseFunctions.inl.

01962 {
01963 #ifdef OSG_USE_STDMATH
01964     return std::fmod(lValue, rValue);
01965 #else
01966     return fmodf(lValue, rValue);
01967 #endif
01968 }

OSG::Real64 OSG::osgMod ( const OSG::Real64  lValue,
const OSG::Real64  rValue 
) [inline]
Parameters:
[in] lValue 
[in] rValue 
Returns:
lValue % rValue
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1973 of file OSGBaseFunctions.inl.

01974 {
01975 #ifdef OSG_USE_STDMATH
01976     return std::fmod(lValue, rValue);
01977 #else
01978     return fmod(lValue, rValue);
01979 #endif
01980 }

template<class FloatTypeT >
OSG::UInt32 OSG::osgFinite ( const FloatTypeT  rValue  )  [inline]

Returns a nonzero value if rValue is a finite number, i.e. neither plus or minus infinity nor NAN.

Parameters:
[in] rValue Number to test.
Returns:
Nonzero value if argument is finite.
Note:
This function forwards to an appropriate C++ or C library function, hence exhibits the respective error behavior.

Definition at line 1999 of file OSGBaseFunctions.inl.

Referenced by OSG::QuaternionBase< ValueTypeT >::setValueAsAxisDeg(), and OSG::QuaternionBase< ValueTypeT >::setValueAsAxisRad().

02000 {
02001 #ifdef WIN32
02002     return _finite(rValue);
02003 #else
02004 # ifdef __hpux
02005     return  isfinite(rValue);
02006 # else
02007 #  ifdef __APPLE__
02008     return  std::isfinite(rValue);
02009 #  else
02010     return  finite(rValue);
02011 #  endif
02012 # endif
02013 #endif
02014 }

template<class TypeT >
TypeT OSG::osgMin ( const TypeT  lValue,
const TypeT  rValue 
) [inline]

Return the smaller of the two arguments.

Parameters:
[in] lValue First value for comparison.
[in] rValue Second value for comparison.
Returns:
The smaller of the two arguments.

Definition at line 2051 of file OSGBaseFunctions.inl.

Referenced by OSG::State::activate(), OSG::DrawEnv::activate(), OSG::OcclusionCullingTreeBuilder::add(), OSG::BalancedMultiWindow::balanceServer(), OSG::QuadTreeTerrain::calcBlend(), OSG::ShaderShadowMapEngine::calcPointLightRange(), OSG::BalancedMultiWindow::calculateServerPort(), OSG::QuadTreeTerrain::changed(), OSG::State::changeFrom(), OSG::DrawEnv::changeTo(), OSG::TextureGrabBackground::clear(), OSG::CErrorQuadTree::ComputeError(), OSG::VarianceShadowMapHandler::configureShadowMaps(), OSG::State::deactivate(), OSG::DrawEnv::deactivate(), OSG::deepClone(), OSG::TiledQuadTreeTerrain::doRenderEnter(), OSG::TextureGrabForeground::draw(), OSG::GrabForeground::draw(), OSG::ExceptionBinaryDataHandler::get(), OSG::FrustumVolume::getBounds(), OSG::ParSpaceTrimmer::getContinuingFace(), OSG::NestedPerfTracker::getFrameRate(), OSG::QuadTreeTerrain::getHeight(), OSG::TileGeometryLoad::getVisibleArea(), OSG::BalancedMultiWindow::getVisibleLoad(), OSG::ShaderShadowMapEngine::handleDirectionalLightEnter(), OSG::GroupMCastConnection::initialize(), OSG::VarianceShadowMapHandler::initShadowMaps(), OSG::BezierCurve2D::minMaxIntersection(), OSG::ParSpaceTrimmer::PerformTrimming2(), OSG::ExceptionBinaryDataHandler::put(), OSG::PointMCastConnection::read(), OSG::TGAImageFileType::read(), OSG::DBBlockAccessor::readBlockA16(), OSG::GDALBlockAccessor::readBlockA16(), OSG::PipelineComposer::readBuffer(), OSG::ExceptionBinaryDataHandler::readBuffer(), OSG::PointMCastConnection::readBuffer(), OSG::ScreenLOD::renderEnter(), OSG::DeferredShadingStage::scheduleGBufferPass(), OSG::ClusterViewBuffer::send(), OSG::MultiDisplayWindow::serverRender(), OSG::Image::setSubData(), OSG::BinarySwapComposer::startReader(), OSG::BalancedMultiWindow::storeViewport(), OSG::Image::subImage(), OSG::DrawEnv::update(), OSG::TileGeometryLoad::updateGeometry(), OSG::DeferredShadingStage::updateStageData(), OSG::MultiDisplayWindow::updateViewport(), and OSG::GroupMCastConnection::write().

02052 {
02053     return ((lValue < rValue) ? lValue : rValue);
02054 }

template<class TypeT >
TypeT OSG::osgMax ( const TypeT  lValue,
const TypeT  rValue 
) [inline]

Return the larger of the two arguments.

Parameters:
[in] lValue First value for comparison.
[in] rValue Second value for comparison.
Returns:
The larger of the two arguments.

Definition at line 2065 of file OSGBaseFunctions.inl.

Referenced by OSG::OcclusionCullingTreeBuilder::add(), OSG::QuadTreeTerrain::calcD2Value(), OSG::Image::calcMipmapGeometry(), OSG::QuadTreeTerrain::calcSubDiv(), OSG::BalancedMultiWindow::calculateServerPort(), OSG::QuadTreeTerrain::changed(), OSG::VerifyGeoGraphOp::checkIndexedGeo(), OSG::CErrorQuadTree::ComputeError(), OSG::createComposedImage(), OSG::BezierCurve3D::createCurve(), OSG::ParticleBSPTree::doBuild(), OSG::Log::doLog(), OSG::TiledQuadTreeTerrain::doRenderEnter(), OSG::GrabForeground::draw(), OSG::RenderNode::estimatePerformance(), OSG::TileLoadBalancer::findBestCut(), OSG::FrustumVolume::getBounds(), OSG::ParSpaceTrimmer::getContinuingFace(), OSG::TileGeometryLoad::getVisibleArea(), OSG::BalancedMultiWindow::getVisibleLoad(), OSG::GroupMCastConnection::GroupMCastConnection(), OSG::ShaderShadowMapEngine::handleDirectionalLightEnter(), OSG::BezierCurve2D::minMaxIntersection(), OSG::ParSpaceTrimmer::PerformTrimming(), OSG::ParSpaceTrimmer::PerformTrimming2(), OSG::BalancedMultiWindow::preloadCache(), OSG::QuadTreeTerrain::propagateD2Errors(), OSG::CSMSceneParameter::reset(), OSG::PrimitiveIterator::seek(), OSG::MultiDisplayWindow::serverRender(), OSG::Image::setSubData(), OSG::SimpleSceneManager::showAll(), OSG::BalancedMultiWindow::splitAxis(), OSG::BalancedMultiWindow::splitViewport(), OSG::TileGeometryLoad::updateGeometry(), and OSG::ShadowStage::updateLights().

02066 {
02067     return ((lValue > rValue) ? lValue : rValue);
02068 }

template<class TypeT >
TypeT OSG::osgClamp ( const TypeT  minVal,
const TypeT  val,
const TypeT  maxVal 
) [inline]

Restrict val to the range [minVal; maxVal], inclusive.

Parameters:
[in] minVal Lower bound of the range.
[in] val Value to clamp.
[in] maxVal Upper bound of the range.
Returns:
The value from the given range that is closest to val.

Definition at line 2080 of file OSGBaseFunctions.inl.

References OSG_ASSERT.

Referenced by OSG::OcclusionCullingTreeBuilder::add(), OSG::TextureObjChunk::handleTexture(), OSG::ScreenLOD::renderEnter(), OSG::TrackballEngine::rotate(), and OSG::OcclusionCullingTreeBuilder::testNode().

02081 {
02082     OSG_ASSERT(minVal < maxVal);
02083
02084     return ((val > minVal) ? ((val < maxVal) ? val : maxVal) : minVal);
02085 }

template<class TypeT >
Int8 OSG::osgSgn ( TypeT  val  )  [inline]

Return the sign of the argument, i.e. -1 if val is negative, 1 if it is positive and 0 otherwise.

Parameters:
[in] val The number to classify.
Returns:
The sign of the argument.

Definition at line 2112 of file OSGBaseFunctions.inl.

Referenced by OSG::TrapezoidalShadowMapEngine::calcTrapezoidalTransform(), and OSG::TrackballEngine::moveTo().

02113 {
02114     if(val < 0)
02115         return -1;
02116
02117     if(val > 0)
02118         return  1;
02119
02120     return 0;
02121 }

template<class TypeT >
void OSG::osgSwap ( TypeT &  lValue,
TypeT &  rValue 
) [inline]

Exchanges the values of the arguments.

Parameters:
[in,out] lValue New value for rValue, is assigned the old value of rValue.
[in,out] rValue New value for lVal, is assigned the old value of rVal.
Note:
It is usually better to use std::swap instead, as it often has special handling for standard library types.

Definition at line 2141 of file OSGBaseFunctions.inl.

02142 {
02143     TypeT val(lValue);
02144
02145     lValue = rValue;
02146     rValue = val;
02147 }

OSG::Real32 OSG::osgDegree2Rad ( const OSG::Real32  rValue  )  [inline]

Converts the argument angle from degrees to radians.

Parameters:
[in] rValue Angle in degree to convert.
Returns:
Angle in radians.

Definition at line 2162 of file OSGBaseFunctions.inl.

02163 {
02164    return (rValue/360.f) * 2.f * 3.1415926535f;
02165 }

OSG::Real64 OSG::osgDegree2Rad ( const OSG::Real64  rValue  )  [inline]

Converts the argument angle from degrees to radians.

Parameters:
[in] rValue Angle in degree to convert.
Returns:
Angle in radians.

Definition at line 2170 of file OSGBaseFunctions.inl.

02171 {
02172    return (rValue/360) * 2 * 3.1415926535;
02173 }

OSG::Fixed32 OSG::osgDegree2Rad ( const OSG::Fixed32  rValue  )  [inline]

Converts the argument angle from degrees to radians.

Parameters:
[in] rValue Angle in degree to convert.
Returns:
Angle in radians.

Definition at line 2178 of file OSGBaseFunctions.inl.

02179 {
02180    return (rValue/360.f) * 2.f * 3.1415926535f;
02181 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgDegree2Rad ( const FloatTypeT  rValue  )  [inline]
OSG::Real32 OSG::osgRad2Degree ( const OSG::Real32  rValue  )  [inline]

Converts the argument angle from radians to degrees.

Parameters:
[in] rValue Angle in radians to convert.
Returns:
Angle in degrees.

Definition at line 2252 of file OSGBaseFunctions.inl.

02253 {
02254     return (rValue/(2.f * 3.1415926535f)) * 360.f;
02255 }

OSG::Real64 OSG::osgRad2Degree ( const OSG::Real64  rValue  )  [inline]

Converts the argument angle from radians to degrees.

Parameters:
[in] rValue Angle in radians to convert.
Returns:
Angle in degrees.

Definition at line 2260 of file OSGBaseFunctions.inl.

02261 {
02262     return (rValue/(2 * 3.1415926535)) * 360;
02263 }

OSG::Fixed32 OSG::osgRad2Degree ( const OSG::Fixed32  rValue  )  [inline]

Converts the argument angle from radians to degrees.

Parameters:
[in] rValue Angle in radians to convert.
Returns:
Angle in degrees.

Definition at line 2268 of file OSGBaseFunctions.inl.

02269 {
02270     return (rValue/(2.f * 3.1415926535f)) * 360.f;
02271 }

template<class FloatTypeT >
TypeTraits< FloatTypeT >::RealReturnType OSG::osgRad2Degree ( const FloatTypeT  rValue  )  [inline]

Converts the argument angle from radians to degrees.

Parameters:
[in] rValue Angle in radians to convert.
Returns:
Angle in degrees.

Definition at line 2277 of file OSGBaseFunctions.inl.

Referenced by OSG::SpotLight::getSpotCutOffDeg(), OSG::QuaternionBase< ValueTypeT >::getValueAsAxisDeg(), OSG::SpotLight::makeChunk(), OSG::DeferredShadingStage::updateLightChunk(), and OSG::ShadowStage::updateLights().

02278 {
02279     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
02280
02281     return  OSG::osgRad2Degree(RealType(rValue));
02282 }

template<>
bool OSG::osgIsPower2< UInt32 > ( const OSG::UInt32  rValue  )  [inline]

Test if the argument is a power of 2 or zero.

Parameters:
[in] rValue Number to test.
Returns:
true if rValue is a power of 2 or zero, false otherwise.
template<>
OSG::UInt32 OSG::osgNextPower2< UInt32 > ( OSG::UInt32  rValue  )  [inline]

Return the next larger power of 2, i.e. the smallest power of 2 not less than rValue.

Parameters:
[in] rValue The lower bound for the wanted power of 2.
Returns:
A power of 2 not less than rValue or 0 if there is no such value within rValue type's range.
template<>
OSG::Int32 OSG::osgNextPower2< Int32 > ( OSG::Int32  rValue  )  [inline]

Return the next larger power of 2, i.e. the smallest power of 2 not less than rValue.

Parameters:
[in] rValue The lower bound for the wanted power of 2.
Returns:
A power of 2 not less than rValue or 0 if there is no such value within rValue type's range.
template<>
OSG::UInt64 OSG::osgNextPower2< UInt64 > ( OSG::UInt64  rValue  )  [inline]

Return the next larger power of 2, i.e. the smallest power of 2 not less than rValue.

Parameters:
[in] rValue The lower bound for the wanted power of 2.
Returns:
A power of 2 not less than rValue or 0 if there is no such value within rValue type's range.
template<>
OSG::Int64 OSG::osgNextPower2< Int64 > ( OSG::Int64  rValue  )  [inline]

Return the next larger power of 2, i.e. the smallest power of 2 not less than rValue.

Parameters:
[in] rValue The lower bound for the wanted power of 2.
Returns:
A power of 2 not less than rValue or 0 if there is no such value within rValue type's range.
template<>
bool OSG::osgIsPower2< Int32 > ( const OSG::Int32  rValue  )  [inline]

Test if the argument is a power of 2 or zero.

Parameters:
[in] rValue Number to test.
Returns:
true if rValue is a power of 2 or zero, false otherwise.
template<>
bool OSG::osgIsPower2< UInt64 > ( const OSG::UInt64  rValue  )  [inline]

Test if the argument is a power of 2 or zero.

Parameters:
[in] rValue Number to test.
Returns:
true if rValue is a power of 2 or zero, false otherwise.
template<>
bool OSG::osgIsPower2< Int64 > ( const OSG::Int64  rValue  )  [inline]

Test if the argument is a power of 2 or zero.

Parameters:
[in] rValue Number to test.
Returns:
true if rValue is a power of 2 or zero, false otherwise.