3 #include <osg\BoundsChecking>
4 #include <osg\BufferObject>
8 struct Sector :
public osg::Referenced
16 const unsigned int ID;
32 this->
start = osg::clampBetween(
start, 0.0, 1.0);
33 this->
end = osg::clampBetween(
end, 0.0, 1.0);
60 unsigned int arraySize = leadSplineSize * crossSectionSize;
62 result->reserve(arraySize);
67 unsigned int sectorStart = int((*it)->start * leadSplineSize) * crossSectionSize;
68 unsigned int sectorEnd = int((*it)->end * leadSplineSize) * crossSectionSize;
70 if(sectorStart == sectorEnd)
continue;
72 if(sectorEnd < sectorStart) sectorEnd += arraySize;
74 double step = 1.0 / (sectorEnd - sectorStart);
77 for (
unsigned int i = sectorStart; i < sectorEnd; ++i)
79 (*result)[i % arraySize] = osg::Vec4(counter, 1.0 - counter, 0, 1.0);
97 osg::clampLEQUAL(i,
_sectors.size(),
"i");