Functions
[Math]


sqrt



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgsqrt (const FloatTypeT rValue)
Real32 osg::osgsqrt (const Real32 rValue)
Real64 osg::osgsqrt (const Real64 rValue)
Real128 osg::osgsqrt (const Real128 rValue)

cos



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgcos (const FloatTypeT rValue)
Real32 osg::osgcos (const Real32 rValue)
Real64 osg::osgcos (const Real64 rValue)
Real128 osg::osgcos (const Real128 rValue)

sin



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgsin (const FloatTypeT rValue)
Real32 osg::osgsin (const Real32 rValue)
Real64 osg::osgsin (const Real64 rValue)
Real128 osg::osgsin (const Real128 rValue)

tan



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgtan (const FloatTypeT rValue)
Real32 osg::osgtan (const Real32 rValue)
Real64 osg::osgtan (const Real64 rValue)
Real128 osg::osgtan (const Real128 rValue)

acos



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgacos (const FloatTypeT rValue)
Real32 osg::osgacos (const Real32 rValue)
Real64 osg::osgacos (const Real64 rValue)
Real128 osg::osgacos (const Real128 rValue)

asin



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgasin (const FloatTypeT rValue)
Real32 osg::osgasin (const Real32 rValue)
Real64 osg::osgasin (const Real64 rValue)
Real128 osg::osgasin (const Real128 rValue)

atan



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgatan (const FloatTypeT rValue)
Real32 osg::osgatan (const Real32 rValue)
Real64 osg::osgatan (const Real64 rValue)
Real128 osg::osgatan (const Real128 rValue)

atan2



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

abs



template<class TypeT>
TypeT osg::osgabs (const TypeT rValue)
Real32 osg::osgabs (const Real32 rValue)
Real64 osg::osgabs (const Real64 rValue)
Real128 osg::osgabs (const Real128 rValue)

pow



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

log



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osglog (const FloatTypeT rValue)
Real32 osg::osglog (const Real32 rValue)
Real64 osg::osglog (const Real64 rValue)
Real128 osg::osglog (const Real128 rValue)

exp



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgexp (const FloatTypeT rValue)
Real32 osg::osgexp (const Real32 rValue)
Real64 osg::osgexp (const Real64 rValue)
Real128 osg::osgexp (const Real128 rValue)

floor



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgfloor (const FloatTypeT rValue)
Real32 osg::osgfloor (const Real32 rValue)
Real64 osg::osgfloor (const Real64 rValue)
Real128 osg::osgfloor (const Real128 rValue)

ceil



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgceil (const FloatTypeT rValue)
Real32 osg::osgceil (const Real32 rValue)
Real64 osg::osgceil (const Real64 rValue)
Real128 osg::osgceil (const Real128 rValue)

finite



template<class FloatTypeT>
UInt32 osg::osgfinite (const FloatTypeT rValue)

min / max



template<class TypeT>
TypeT osg::osgMin (const TypeT lVal, const TypeT rValue)
template<class TypeT>
TypeT osg::osgMax (const TypeT lVal, 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 &lVal, TypeT &rValue)

degree2rad



Real32 osg::osgdegree2rad (const Real32 rValue)
Real64 osg::osgdegree2rad (const Real64 rValue)
template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgdegree2rad (const FloatTypeT rValue)

rad2degree



Real32 osg::osgrad2degree (const Real32 rValue)
Real64 osg::osgrad2degree (const Real64 rValue)
template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::osgrad2degree (const FloatTypeT rValue)

deg2rad / rad2deg



template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::deg2rad (const FloatTypeT rValue)
template<class FloatTypeT>
TypeTraits< FloatTypeT >
::RealReturnType 
osg::rad2deg (const FloatTypeT rValue)

ispower2



bool osg::osgispower2 (UInt32 rValue)
bool osg::osgispower2 (Int32 rValue)

nextpower2



UInt32 osg::osgnextpower2 (UInt32 rValue)
Int32 osg::osgnextpower2 (Int32 rValue)
Int64 osg::osgnextpower2 (Int64 rValue)
template<>
UInt64 osg::osgnextpower2< UInt64 > (UInt64 rValue)

Detailed Description

ToDo

Function Documentation

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgsqrt ( const FloatTypeT  rValue  )  [inline]

Real32 osg::osgsqrt ( const Real32  rValue  )  [inline]

Definition at line 72 of file OSGBaseFunctions.inl.

00073 {
00074 #ifdef OSG_USE_STDMATH
00075     return std::sqrt(rValue);
00076 #elif defined(OSG_HAS_FLOATMATH)
00077     return sqrtf(rValue);
00078 #else
00079     return (Real32) sqrt((Real32) rValue);
00080 #endif
00081 }

Real64 osg::osgsqrt ( const Real64  rValue  )  [inline]

Definition at line 87 of file OSGBaseFunctions.inl.

00088 {
00089 #ifdef OSG_USE_STDMATH
00090     return std::sqrt(rValue);
00091 #else
00092     return sqrt(rValue);
00093 #endif
00094 }

Real128 osg::osgsqrt ( const Real128  rValue  )  [inline]

Definition at line 100 of file OSGBaseFunctions.inl.

Referenced by osg::osgsqrt().

00101 {
00102 #ifdef OSG_USE_STDMATH
00103     return std::sqrt(rValue);
00104 #else
00105     return sqrtl(rValue);
00106 #endif
00107 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgcos ( const FloatTypeT  rValue  )  [inline]

Real32 osg::osgcos ( const Real32  rValue  )  [inline]

Definition at line 130 of file OSGBaseFunctions.inl.

00131 {
00132 #ifdef OSG_USE_STDMATH
00133     return std::cos(rValue);
00134 #elif defined(OSG_HAS_FLOATMATH)
00135     return cosf(rValue);
00136 #else
00137     return (Real32) cos((Real32) rValue);
00138 #endif
00139 }

Real64 osg::osgcos ( const Real64  rValue  )  [inline]

Definition at line 145 of file OSGBaseFunctions.inl.

00146 {
00147 #ifdef OSG_USE_STDMATH
00148     return std::cos(rValue);
00149 #else
00150     return cos(rValue);
00151 #endif
00152 }

Real128 osg::osgcos ( const Real128  rValue  )  [inline]

Definition at line 158 of file OSGBaseFunctions.inl.

Referenced by osg::osgcos().

00159 {
00160 #ifdef OSG_USE_STDMATH
00161     return std::cos(rValue);
00162 #else
00163     return cosl(rValue);
00164 #endif
00165 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgsin ( const FloatTypeT  rValue  )  [inline]

Real32 osg::osgsin ( const Real32  rValue  )  [inline]

Definition at line 188 of file OSGBaseFunctions.inl.

00189 {
00190 #ifdef OSG_USE_STDMATH
00191     return std::sin(rValue);
00192 #elif defined(OSG_HAS_FLOATMATH)
00193     return sinf(rValue);
00194 #else
00195     return (Real32) sin((Real32) rValue);
00196 #endif
00197 }

Real64 osg::osgsin ( const Real64  rValue  )  [inline]

Definition at line 203 of file OSGBaseFunctions.inl.

00204 {
00205 #ifdef OSG_USE_STDMATH
00206     return std::sin(rValue);
00207 #else
00208     return sin(rValue);
00209 #endif
00210 }

Real128 osg::osgsin ( const Real128  rValue  )  [inline]

Definition at line 216 of file OSGBaseFunctions.inl.

Referenced by osg::osgsin().

00217 {
00218 #ifdef OSG_USE_STDMATH
00219     return std::sin(rValue);
00220 #else
00221     return sinl(rValue);
00222 #endif
00223 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgtan ( const FloatTypeT  rValue  )  [inline]

Definition at line 235 of file OSGBaseFunctions.inl.

References osg::osgtan().

Referenced by osg::OffCenterPerspectiveCamera::MatrixPerspectivePrincipalPnt(), and osg::SimpleSceneManager::showAll().

00236 {
00237     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00238 
00239     return  osgtan(RealType(rValue));
00240 }

Real32 osg::osgtan ( const Real32  rValue  )  [inline]

Definition at line 246 of file OSGBaseFunctions.inl.

00247 {
00248 #ifdef OSG_USE_STDMATH
00249     return std::tan(rValue);
00250 #elif defined(OSG_HAS_FLOATMATH)
00251     return tanf(rValue);
00252 #else
00253     return (Real32) tan((Real32) rValue);
00254 #endif
00255 }

Real64 osg::osgtan ( const Real64  rValue  )  [inline]

Definition at line 261 of file OSGBaseFunctions.inl.

00262 {
00263 #ifdef OSG_USE_STDMATH
00264     return std::tan(rValue);
00265 #else
00266     return tan(rValue);
00267 #endif
00268 }

Real128 osg::osgtan ( const Real128  rValue  )  [inline]

Definition at line 274 of file OSGBaseFunctions.inl.

Referenced by osg::MatrixPerspective(), osg::MatrixStereoPerspective(), and osg::osgtan().

00275 {
00276 #ifdef OSG_USE_STDMATH
00277     return std::tan(rValue);
00278 #else
00279     return tanl(rValue);
00280 #endif
00281 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgacos ( const FloatTypeT  rValue  )  [inline]

Definition at line 293 of file OSGBaseFunctions.inl.

References osg::osgacos().

Referenced by osg::createNormalVolume(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::enclosedAngle(), osg::TextVectorGlyph::getNormals(), osg::QuaternionBase< ValueTypeT >::getValueAsAxisDeg(), osg::makeSphereGeo(), and osg::QuaternionBase< ValueTypeT >::slerp().

00294 {
00295     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00296 
00297     return  osgacos(RealType(rValue));
00298 }

Real32 osg::osgacos ( const Real32  rValue  )  [inline]

Definition at line 304 of file OSGBaseFunctions.inl.

00305 {
00306 #ifdef OSG_USE_STDMATH
00307     return std::acos(rValue);
00308 #elif defined(OSG_HAS_FLOATMATH)
00309     return acosf(rValue);
00310 #else
00311     return (Real32) acos((Real32) rValue);
00312 #endif
00313 }

Real64 osg::osgacos ( const Real64  rValue  )  [inline]

Definition at line 319 of file OSGBaseFunctions.inl.

00320 {
00321 #ifdef OSG_USE_STDMATH
00322     return std::acos(rValue);
00323 #else
00324     return acos(rValue);
00325 #endif
00326 }

Real128 osg::osgacos ( const Real128  rValue  )  [inline]

Definition at line 332 of file OSGBaseFunctions.inl.

Referenced by osg::osgacos().

00333 {
00334 #ifdef OSG_USE_STDMATH
00335     return std::acos(rValue);
00336 #else
00337     return acosl(rValue);
00338 #endif
00339 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgasin ( const FloatTypeT  rValue  )  [inline]

Definition at line 351 of file OSGBaseFunctions.inl.

References osg::osgasin().

Referenced by osg::TrackballNavigator::rotate(), and osg::Trackball::updateRotation().

00352 {
00353     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00354 
00355     return  osgasin(RealType(rValue));
00356 }

Real32 osg::osgasin ( const Real32  rValue  )  [inline]

Definition at line 362 of file OSGBaseFunctions.inl.

00363 {
00364 #ifdef OSG_USE_STDMATH
00365     return std::asin(rValue);
00366 #elif defined(OSG_HAS_FLOATMATH)
00367     return asinf(rValue);
00368 #else
00369     return (Real32) asin((Real32) rValue);
00370 #endif
00371 }

Real64 osg::osgasin ( const Real64  rValue  )  [inline]

Definition at line 378 of file OSGBaseFunctions.inl.

00379 {
00380 #ifdef OSG_USE_STDMATH
00381     return std::asin(rValue);
00382 #else
00383     return asin(rValue);
00384 #endif
00385 }

Real128 osg::osgasin ( const Real128  rValue  )  [inline]

Definition at line 391 of file OSGBaseFunctions.inl.

Referenced by osg::osgasin().

00392 {
00393 #ifdef OSG_USE_STDMATH
00394     return std::asin(rValue);
00395 #else
00396     return asinl(rValue);
00397 #endif
00398 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgatan ( const FloatTypeT  rValue  )  [inline]

Definition at line 410 of file OSGBaseFunctions.inl.

References osg::osgatan().

00411 {
00412     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00413 
00414     return  osgatan(RealType(rValue));
00415 }

Real32 osg::osgatan ( const Real32  rValue  )  [inline]

Definition at line 421 of file OSGBaseFunctions.inl.

00422 {
00423 #ifdef OSG_USE_STDMATH
00424     return std::atan(rValue);
00425 #elif defined(OSG_HAS_FLOATMATH)
00426     return atanf(rValue);
00427 #else
00428     return (Real32) atan((Real32) rValue);
00429 #endif
00430 }

Real64 osg::osgatan ( const Real64  rValue  )  [inline]

Definition at line 436 of file OSGBaseFunctions.inl.

00437 {
00438 #ifdef OSG_USE_STDMATH
00439     return std::atan(rValue);
00440 #else
00441     return atan(rValue);
00442 #endif
00443 }

Real128 osg::osgatan ( const Real128  rValue  )  [inline]

Definition at line 449 of file OSGBaseFunctions.inl.

Referenced by osg::osgatan().

00450 {
00451 #ifdef OSG_USE_STDMATH
00452     return std::atan(rValue);
00453 #else
00454     return atanl(rValue);
00455 #endif
00456 }

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

Definition at line 468 of file OSGBaseFunctions.inl.

References osg::osgatan2().

00470 {
00471     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00472 
00473     return  osgatan2(RealType(rValue1), RealType(rValue2));
00474 }

Real32 osg::osgatan2 ( const Real32  rValue1,
const Real32  rValue2 
) [inline]

Definition at line 480 of file OSGBaseFunctions.inl.

00481 {
00482 #ifdef OSG_USE_STDMATH
00483     return std::atan2(rValue1, rValue2);
00484 #elif defined(OSG_HAS_FLOATMATH)
00485 #ifndef _OSG_HAS_ATANF2__
00486     return atan2f(rValue1, rValue2);
00487 #else
00488     return (Real32) atan2((Real32) rValue1, (Real32) rValue2);
00489 #endif
00490 #else
00491     return (Real32) atan2((Real32) rValue1, (Real32) rValue2);
00492 #endif
00493 }

Real64 osg::osgatan2 ( const Real64  rValue1,
const Real64  rValue2 
) [inline]

Definition at line 499 of file OSGBaseFunctions.inl.

00500 {
00501 #ifdef OSG_USE_STDMATH
00502     return std::atan2(rValue1, rValue2);
00503 #else
00504     return atan2(rValue1, rValue2);
00505 #endif
00506 }

Real128 osg::osgatan2 ( const Real128  rValue1,
const Real128  rValue2 
) [inline]

Definition at line 512 of file OSGBaseFunctions.inl.

Referenced by osg::osgatan2().

00513 {
00514 #ifdef OSG_USE_STDMATH
00515     return std::atan2(rValue1, rValue2);
00516 #else
00517     return atan2l(rValue1, rValue2);
00518 #endif
00519 }

template<class TypeT>
TypeT osg::osgabs ( const TypeT  rValue  )  [inline]

Definition at line 530 of file OSGBaseFunctions.inl.

00531 {
00532     return (rValue > 0) ? rValue : -rValue;
00533 }

Real32 osg::osgabs ( const Real32  rValue  )  [inline]

Definition at line 539 of file OSGBaseFunctions.inl.

00540 {
00541 #ifdef OSG_USE_STDMATH
00542     return std::abs(rValue);
00543 #elif defined(OSG_HAS_FLOATMATH) && !defined(OSG_NO_FABSF)
00544     return fabsf(rValue);
00545 #else
00546     return (Real32) fabs((Real32) rValue);
00547 #endif
00548 }

Real64 osg::osgabs ( const Real64  rValue  )  [inline]

Definition at line 554 of file OSGBaseFunctions.inl.

00555 {
00556 #ifdef OSG_USE_STDMATH
00557     return std::abs(rValue);
00558 #else
00559     return fabs(rValue);
00560 #endif
00561 }

Real128 osg::osgabs ( const Real128  rValue  )  [inline]

Definition at line 567 of file OSGBaseFunctions.inl.

Referenced by osg::dist3D_Segment_to_Segment(), osg::MatrixPerspective(), and osg::MatrixStereoPerspective().

00568 {
00569 #ifdef OSG_USE_STDMATH
00570     return std::abs(rValue);
00571 #else
00572     return fabsl(rValue);
00573 #endif
00574 }

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

Definition at line 586 of file OSGBaseFunctions.inl.

References osg::osgpow().

Referenced by osg::createPhongVolume(), osg::makeSphereGeo(), osg::Navigator::moveTo(), osg::Brick::render3DSlices(), osg::TransformationMatrix< ValueTypeT >::sqrt(), osg::TransformationMatrix< ValueTypeT >::sqrtOf(), and osg::FresnelMaterial::updateFresnel().

00588 {
00589     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00590 
00591     return  osgpow(RealType(rValue), RealType(rExp));
00592 }

Real32 osg::osgpow ( const Real32  rValue,
const Real32  rExp 
) [inline]

Definition at line 598 of file OSGBaseFunctions.inl.

00599 {
00600 #ifdef OSG_USE_STDMATH
00601     return std::pow(rValue, rExp);
00602 #elif defined(OSG_HAS_FLOATMATH)
00603     return powf(rValue, rExp);
00604 #else
00605     return (Real32) pow((Real32) rValue, (Real32) rExp);
00606 #endif
00607 }

Real64 osg::osgpow ( const Real64  rValue,
const Real64  rExp 
) [inline]

Definition at line 613 of file OSGBaseFunctions.inl.

00614 {
00615 #ifdef OSG_USE_STDMATH
00616     return std::pow(rValue, rExp);
00617 #else
00618     return pow(rValue, rExp);
00619 #endif
00620 }

Real128 osg::osgpow ( const Real128  rValue,
const Real128  rExp 
) [inline]

Definition at line 626 of file OSGBaseFunctions.inl.

Referenced by osg::osgpow().

00627 {
00628 #ifdef OSG_USE_STDMATH
00629     return std::pow(rValue, rExp);
00630 #else
00631     return powl(rValue, rExp);
00632 #endif
00633 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osglog ( const FloatTypeT  rValue  )  [inline]

Definition at line 645 of file OSGBaseFunctions.inl.

References osg::osglog().

Referenced by osg::TransformationMatrix< ValueTypeT >::exp(), and osg::TransformationMatrix< ValueTypeT >::expOf().

00646 {
00647     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00648 
00649     return  osglog(RealType(rValue));
00650 }

Real32 osg::osglog ( const Real32  rValue  )  [inline]

Definition at line 656 of file OSGBaseFunctions.inl.

00657 {
00658 #ifdef OSG_USE_STDMATH
00659     return std::log(rValue);
00660 #elif defined(OSG_HAS_FLOATMATH)
00661     return logf(rValue);
00662 #else
00663     return (Real32) log((Real32) rValue);
00664 #endif
00665 }

Real64 osg::osglog ( const Real64  rValue  )  [inline]

Definition at line 671 of file OSGBaseFunctions.inl.

00672 {
00673 #ifdef OSG_USE_STDMATH
00674     return std::log(rValue);
00675 #else
00676     return log(rValue);
00677 #endif
00678 }

Real128 osg::osglog ( const Real128  rValue  )  [inline]

Definition at line 684 of file OSGBaseFunctions.inl.

Referenced by osg::osglog().

00685 {
00686 #ifdef OSG_USE_STDMATH
00687     return std::log(rValue);
00688 #else
00689     return logl(rValue);
00690 #endif
00691 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgexp ( const FloatTypeT  rValue  )  [inline]

Definition at line 703 of file OSGBaseFunctions.inl.

References osg::osgexp().

00704 {
00705     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00706 
00707     return  osgexp(RealType(rValue));
00708 }

Real32 osg::osgexp ( const Real32  rValue  )  [inline]

Definition at line 714 of file OSGBaseFunctions.inl.

00715 {
00716 #ifdef OSG_USE_STDMATH
00717     return std::exp(rValue);
00718 #elif defined(OSG_HAS_FLOATMATH)
00719     return expf(rValue);
00720 #else
00721     return (Real32) exp((Real32) rValue);
00722 #endif
00723 }

Real64 osg::osgexp ( const Real64  rValue  )  [inline]

Definition at line 729 of file OSGBaseFunctions.inl.

00730 {
00731 #ifdef OSG_USE_STDMATH
00732     return std::exp(rValue);
00733 #else
00734     return exp(rValue);
00735 #endif
00736 }

Real128 osg::osgexp ( const Real128  rValue  )  [inline]

Definition at line 742 of file OSGBaseFunctions.inl.

Referenced by osg::osgexp().

00743 {
00744 #ifdef OSG_USE_STDMATH
00745     return std::exp(rValue);
00746 #else
00747     return expl(rValue);
00748 #endif
00749 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgfloor ( const FloatTypeT  rValue  )  [inline]

Definition at line 761 of file OSGBaseFunctions.inl.

References osg::osgfloor().

Referenced by osg::DVRIsoShader::deactivate_ColorMatrixShading().

00762 {
00763     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00764 
00765     return  osgfloor(RealType(rValue));
00766 }

Real32 osg::osgfloor ( const Real32  rValue  )  [inline]

Definition at line 772 of file OSGBaseFunctions.inl.

00773 {
00774 #ifdef OSG_USE_STDMATH
00775     return std::floor(rValue);
00776 #elif defined(OSG_HAS_FLOATMATH)
00777 # ifdef OSG_HPUX_ACC
00778     return (Real32) floor((Real32) rValue);
00779 # else
00780     return floorf(rValue);
00781 # endif
00782 #else
00783     return (Real32) floor((Real32) rValue);
00784 #endif
00785 }

Real64 osg::osgfloor ( const Real64  rValue  )  [inline]

Definition at line 791 of file OSGBaseFunctions.inl.

00792 {
00793 #ifdef OSG_USE_STDMATH
00794     return std::floor(rValue);
00795 #else
00796     return floor(rValue);
00797 #endif
00798 }

Real128 osg::osgfloor ( const Real128  rValue  )  [inline]

Definition at line 804 of file OSGBaseFunctions.inl.

Referenced by osg::osgfloor().

00805 {
00806 #ifdef OSG_USE_STDMATH
00807     return std::floor(rValue);
00808 #else
00809     return floorl(rValue);
00810 #endif
00811 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgceil ( const FloatTypeT  rValue  )  [inline]

Definition at line 823 of file OSGBaseFunctions.inl.

References osg::osgceil().

Referenced by osg::TextureManager::calcBrickSubdivision(), osg::DVRIsoShader::deactivate_ColorMatrixShading(), and osg::TextPixmapFace::makeImage().

00824 {
00825     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
00826 
00827     return  osgceil(RealType(rValue));
00828 }

Real32 osg::osgceil ( const Real32  rValue  )  [inline]

Definition at line 834 of file OSGBaseFunctions.inl.

00835 {
00836 #ifdef OSG_USE_STDMATH
00837     return std::ceil(rValue);
00838 #elif defined(OSG_HAS_FLOATMATH)
00839 # ifdef OSG_HPUX_ACC
00840     return (Real32) ceil((Real32) rValue);
00841 # else
00842     return ceilf(rValue);
00843 # endif
00844 #else
00845     return (Real32) ceil((Real32) rValue);
00846 #endif
00847 }

Real64 osg::osgceil ( const Real64  rValue  )  [inline]

Definition at line 853 of file OSGBaseFunctions.inl.

00854 {
00855 #ifdef OSG_USE_STDMATH
00856     return std::ceil(rValue);
00857 #else
00858     return ceil(rValue);
00859 #endif
00860 }

Real128 osg::osgceil ( const Real128  rValue  )  [inline]

Definition at line 866 of file OSGBaseFunctions.inl.

Referenced by osg::osgceil().

00867 {
00868 #ifdef OSG_USE_STDMATH
00869     return std::ceil(rValue);
00870 #else
00871     return ceill(rValue);
00872 #endif
00873 }

template<class FloatTypeT>
UInt32 osg::osgfinite ( const FloatTypeT  rValue  )  [inline]

Definition at line 884 of file OSGBaseFunctions.inl.

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

00885 {
00886 #ifdef WIN32
00887     return _finite(rValue);
00888 #else
00889 #ifdef __hpux
00890     return  isfinite(rValue);
00891 #else
00892     return  finite(rValue);
00893 #endif
00894 #endif
00895 }

template<class TypeT>
TypeT osg::osgMin ( const TypeT  lVal,
const TypeT  rValue 
) [inline]

template<class TypeT>
TypeT osg::osgMax ( const TypeT  lVal,
const TypeT  rValue 
) [inline]

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

Clamp val to [minVal - maxVal].

Definition at line 925 of file OSGBaseFunctions.inl.

Referenced by osg::createPhongVolume(), and osg::TrackballNavigator::rotate().

00926 {
00927     return ((val > minVal) ? ((val < maxVal) ? val : maxVal) : minVal);
00928 }

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

Definition at line 939 of file OSGBaseFunctions.inl.

Referenced by osg::Navigator::moveTo().

00940 {
00941     if(val < 0)
00942         return -1;
00943         
00944     if(val > 0)
00945         return  1;
00946     
00947     return 0;
00948 }

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

Definition at line 959 of file OSGBaseFunctions.inl.

Referenced by osg::Slices::createSlice().

00960 {
00961     TypeT val(lVal);
00962 
00963     lVal = rValue;
00964     rValue = val;
00965 }

Real32 osg::osgdegree2rad ( const Real32  rValue  )  [inline]

Definition at line 976 of file OSGBaseFunctions.inl.

00977 {
00978    return (rValue/360.f) * 2.f * 3.1415926535f;
00979 }

Real64 osg::osgdegree2rad ( const Real64  rValue  )  [inline]

Definition at line 985 of file OSGBaseFunctions.inl.

Referenced by osg::deg2rad(), and osg::osgdegree2rad().

00986 {
00987    return (rValue/360) * 2 * 3.1415926535;
00988 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgdegree2rad ( const FloatTypeT  rValue  )  [inline]

Real32 osg::osgrad2degree ( const Real32  rValue  )  [inline]

Definition at line 1011 of file OSGBaseFunctions.inl.

01012 {
01013     return (rValue/(2.f * 3.1415926535f)) * 360.f;
01014 }

Real64 osg::osgrad2degree ( const Real64  rValue  )  [inline]

Definition at line 1020 of file OSGBaseFunctions.inl.

Referenced by osg::osgrad2degree(), and osg::rad2deg().

01021 {
01022     return (rValue/(2 * 3.1415926535)) * 360;
01023 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::osgrad2degree ( const FloatTypeT  rValue  )  [inline]

Definition at line 1030 of file OSGBaseFunctions.inl.

References osg::osgrad2degree().

Referenced by osg::SpotLight::getSpotCutOffDeg(), and osg::QuaternionBase< ValueTypeT >::getValueAsAxisDeg().

01031 {
01032     typedef typename TypeTraits<FloatTypeT>::RealReturnType RealType;
01033 
01034     return  OSG::osgrad2degree(RealType(rValue));
01035 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::deg2rad ( const FloatTypeT  rValue  )  [inline]

Definition at line 1047 of file OSGBaseFunctions.inl.

References osg::osgdegree2rad().

Referenced by osg::SimpleSceneManager::initialize().

01048 {
01049     return osgdegree2rad(rValue);
01050 }

template<class FloatTypeT>
TypeTraits< FloatTypeT >::RealReturnType osg::rad2deg ( const FloatTypeT  rValue  )  [inline]

Definition at line 1057 of file OSGBaseFunctions.inl.

References osg::osgrad2degree().

Referenced by osg::SpotLight::drawEnter(), and osg::SpotLight::makeChunk().

01058 {
01059     return osgrad2degree(rValue);
01060 }

bool osg::osgispower2 ( UInt32  rValue  )  [inline]

Definition at line 1071 of file OSGBaseFunctions.inl.

01072 {
01073     // find the lowest 1 bit
01074     while(rValue && ! (rValue & 1))
01075     {
01076         rValue >>= 1;
01077     }
01078 
01079     // shift the 1 bit out
01080     rValue >>= 1;
01081 
01082     // if another 1 left => not 2^
01083     if(rValue)
01084         return false;
01085     else            
01086         return true;
01087 }

bool osg::osgispower2 ( Int32  rValue  )  [inline]

Definition at line 1093 of file OSGBaseFunctions.inl.

01094 {
01095     // find the lowest 1 bit
01096     while(rValue && ! (rValue & 1))
01097     {
01098         rValue >>= 1;
01099     }
01100 
01101     // shift the 1 bit out
01102     rValue >>= 1;
01103 
01104     // if another 1 left => not 2^
01105     if(rValue)
01106         return false;
01107     else
01108         return true;
01109 }

UInt32 osg::osgnextpower2 ( UInt32  rValue  )  [inline]

Definition at line 1120 of file OSGBaseFunctions.inl.

01121 {
01122     UInt32 result = 1, oresult = 0;
01123 
01124     while(result < rValue && result > oresult)
01125     {
01126         oresult = result;
01127         result <<= 1;
01128     }
01129 
01130     return (result > oresult)? result : 0;
01131 }

Int32 osg::osgnextpower2 ( Int32  rValue  )  [inline]

Definition at line 1137 of file OSGBaseFunctions.inl.

01138 {
01139     Int32 result = 1, oresult = 0;
01140 
01141     while(result < rValue && result > oresult)
01142     {
01143         oresult = result;
01144         result <<= 1;
01145     }
01146 
01147     return (result > oresult)? result : 0;
01148 }

Int64 osg::osgnextpower2 ( Int64  rValue  )  [inline]

Definition at line 1154 of file OSGBaseFunctions.inl.

01155 {
01156     Int64 result = 1, oresult = 0;
01157 
01158     while(result < rValue && result > oresult)
01159     {
01160         oresult = result;
01161         result <<= 1;
01162     }
01163 
01164     return (result > oresult)? result : 0;
01165 }

template<>
UInt64 osg::osgnextpower2< UInt64 > ( UInt64  rValue  )  [inline]


Generated on Mon Mar 17 11:10:28 2008 for OpenSG by  doxygen 1.5.5