00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright 2000,2001 by OpenSG Forum * 00006 * * 00007 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00008 * * 00009 \*---------------------------------------------------------------------------*/ 00010 /*---------------------------------------------------------------------------*\ 00011 * License * 00012 * * 00013 * This library is free software; you can redistribute it and/or modify it * 00014 * under the terms of the GNU Library General Public License as published * 00015 * by the Free Software Foundation, version 2. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, but * 00018 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00020 * Library General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Library General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00025 * * 00026 \*---------------------------------------------------------------------------*/ 00027 /*---------------------------------------------------------------------------*\ 00028 * Changes * 00029 * * 00030 * * 00031 * * 00032 * * 00033 * * 00034 * * 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #include <OSGConfig.h> 00038 00039 OSG_BEGIN_NAMESPACE 00040 00041 inline Real32 TileGeometryLoad::getFaceDistribution(UInt32 dir,Real32 cut) 00042 { 00043 if(cut<=0) 00044 { 00045 return 0.0; 00046 } 00047 if(cut >=1.0) 00048 { 00049 return 1.0; 00050 } 00051 cut*=FACE_DISTRIBUTION_SAMPLING_COUNT-1; 00052 00053 UInt32 a=(UInt32)(floor(cut)); 00054 Real32 f=cut-a; 00055 00056 return _faceDistribution[dir][a] + 00057 (_faceDistribution[dir][a+1] - _faceDistribution[dir][a]) * f; 00058 } 00059 00060 OSG_END_NAMESPACE 00061 00062 #define OSGTILEGEOMETRYLOAD_INLINE_CVSID "@(#)$Id:$" 00063 00064 00065 00066 00067
1.4.3