msgamelover
01-06-2010 05:47:05
As title mentioned
In ogre 1.7 getLodIndexSquaredDepth no exist and in pagedGeometry-1.1.0
instead of
but when i compile example 1 with this(pagedGeometry-1.1.0 ,ogre 1.7, vs2008), i havent seen any trees
then i look for answers in source code
in ogre1.6.5
in ogre1.7
i think getLodIndex(
as parent->minDistanceSquared is acturally a squares value you can find this
so you just past
but modified this i still cannt seen any trees, i don't kong why ? any one help me ,thanks a lot
In ogre 1.7 getLodIndexSquaredDepth no exist and in pagedGeometry-1.1.0
material->getLodIndex(parent->minDistanceSquared * parent->minDistanceSquared));instead of
bestTechnqiue = material->getBestTechnique(material->getLodIndexSquaredDepth(parent->minDistanceSquared));but when i compile example 1 with this(pagedGeometry-1.1.0 ,ogre 1.7, vs2008), i havent seen any trees
then i look for answers in source code
in ogre1.6.5
unsigned short Material::getLodIndex(Real d) const
{
return getLodIndexSquaredDepth(d * d);
}
// --------------------------------------------------------------------
unsigned short Material::getLodIndexSquaredDepth(Real squaredDistance) const
{
LodDistanceList::const_iterator i, iend;
iend = mLodDistances.end();
unsigned short index = 0;
for (i = mLodDistances.begin(); i != iend; ++i, ++index)
{
if (*i > squaredDistance)
{
return index - 1;
}
}
// If we fall all the way through, use the highest value
return static_cast<ushort>(mLodDistances.size() - 1);
}in ogre1.7
ushort Material::getLodIndex(Real value) const
{
return mLodStrategy->getIndex(value, mLodValues);
}
// Initialise to default strategy
mLodStrategy = LodStrategyManager::getSingleton().getDefaultStrategy();
LodStrategyManager::LodStrategyManager()
{
// Add default (distance) strategy
LodStrategy *distanceStrategy = OGRE_NEW DistanceLodStrategy();
addStrategy(distanceStrategy);
// Add new pixel-count strategy
LodStrategy *pixelCountStrategy = OGRE_NEW PixelCountLodStrategy();
addStrategy(pixelCountStrategy);
// Set the default strategy
setDefaultStrategy(distanceStrategy);
ushort DistanceLodStrategy::getIndex(Real value, const Material::LodValueList& materialLodValueList) const
{
// Get index assuming ascending values
return getIndexAscending(value, materialLodValueList);
}
ushort LodStrategy::getIndexAscending(Real value, const Mesh::MeshLodUsageList& meshLodUsageList)
{
Mesh::MeshLodUsageList::const_iterator i, iend;
iend = meshLodUsageList.end();
ushort index = 0;
for (i = meshLodUsageList.begin(); i != iend; ++i, ++index)
{
[quote] if (i->value > value)[/quote]
{
return index ? index - 1 : 0;
}
}
// If we fall all the way through, use the highest value
return static_cast<ushort>(meshLodUsageList.size() - 1);
}i think getLodIndex(
parent->minDistanceSquared * parent->minDistanceSquared)) is not right
as parent->minDistanceSquared is acturally a squares value you can find this
minDistanceSquared = max(0.0f, centerDistanceSquared - (radius * radius));
so you just past
getLodIndex(parent->minDistanceSquared)it is right
but modified this i still cannt seen any trees, i don't kong why ? any one help me ,thanks a lot