From bd895f94d46dd1cf9e817d56a40e3c6e951e59b2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 9 May 2006 09:35:12 +0000 Subject: [PATCH] From Farshid Lashari, round funciton. --- include/osg/Math | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/osg/Math b/include/osg/Math index a31a784ea..25235f254 100644 --- a/include/osg/Math +++ b/include/osg/Math @@ -165,6 +165,9 @@ inline double DegreesToRadians(double angle) { return angle*PI/180.0; } inline float RadiansToDegrees(float angle) { return angle*180.0f/(float)PI; } inline double RadiansToDegrees(double angle) { return angle*180.0/PI; } +inline float round(float v) { return v>=0.0f?floorf(v+0.5f):ceilf(v-0.5f); } +inline double round(double v) { return v>=0.0?floor(v+0.5):ceil(v-0.5); } + #if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__) inline bool isNaN(float v) { return _isnan(v)!=0; } inline bool isNaN(double v) { return _isnan(v)!=0; }