Work on mesh decimation.

This commit is contained in:
David Williams
2007-09-19 07:38:04 +00:00
parent 32204b483f
commit 152a79eaa9
7 changed files with 35 additions and 94 deletions

View File

@ -90,56 +90,11 @@ namespace Ogre
return (lhsOffset == rhsOffset) /*&& (abs(lhs.alpha - rhs.alpha) <= 0.01)*/;
}
bool operator < (const SurfaceVertex& lhs, const SurfaceVertex& rhs)
/*bool operator < (const SurfaceVertex& lhs, const SurfaceVertex& rhs)
{
/*if((*this) == rhs)
{
return false;
}
if(alpha < rhs.alpha)
{
return true;
}*/
/*if(position.z < rhs.position.z)
{
return true;
}
if(position.y < rhs.position.y)
{
return true;
}
if(position.x < rhs.position.x)
{
return true;
}
return false;*/
/*ulong value = 0;
value |= position.x;
value << 10;
value |= position.y;
value << 10;
value |= position.z;
ulong rhsValue = 0;
rhsValue |= rhs.position.x;
rhsValue << 10;
rhsValue |= rhs.position.y;
rhsValue << 10;
rhsValue |= rhs.position.z;
return value < rhsValue;*/
unsigned long lhsOffset = (lhs.position.x*(OGRE_REGION_SIDE_LENGTH*2+1)*(OGRE_REGION_SIDE_LENGTH*2+1)) + (lhs.position.y*(OGRE_REGION_SIDE_LENGTH*2+1)) + (lhs.position.z);
unsigned long rhsOffset = (rhs.position.x*(OGRE_REGION_SIDE_LENGTH*2+1)*(OGRE_REGION_SIDE_LENGTH*2+1)) + (rhs.position.y*(OGRE_REGION_SIDE_LENGTH*2+1)) + (rhs.position.z);
return lhsOffset < rhsOffset;
/*if(lhsOffset == rhsOffset)
{
return (lhs.alpha < rhs.alpha);
}
return (lhsOffset < rhsOffset)*/;
}
return lhsOffset < rhsOffset;
}*/
}