Exemplo n.º 1
0
    //---------------------------------------------------------------------
    ushort LodStrategy::getIndexDescending(Real value, const Material::LodValueList& materialLodValueList)
    {
        Material::LodValueList::const_iterator i, iend;
        iend = materialLodValueList.end();
        unsigned short index = 0;
        for (i = materialLodValueList.begin(); i != iend; ++i, ++index)
        {
            if (*i < value)
            {
				return index ? index - 1 : 0;
            }
        }

        // If we fall all the way through, use the highest value
        return static_cast<ushort>(materialLodValueList.size() - 1);
    }