Work on mesh decimation.

This commit is contained in:
David Williams
2007-09-07 23:13:10 +00:00
parent 49846fa5d9
commit c2194378cd
11 changed files with 248 additions and 32 deletions

View File

@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define __IntegralVector3_H__
#include <OgrePrerequisites.h>
#include <OgreVector3.h>
namespace Ogre
{
@ -55,7 +56,12 @@ namespace Ogre
return (z < rhs.z);
else
return false; //They are equal
}
}
Vector3 toOgreVector3(void)
{
return Vector3(Real(x), Real(y), Real(z));
}
Type x;
Type y;

View File

@ -39,11 +39,18 @@ namespace Ogre
SurfaceTriangleIterator triangle;
SurfaceEdgeIterator previousHalfEdge;
SurfaceEdgeIterator nextHalfEdge;
SurfaceEdgeIterator otherHalfEdge;
//FIXME - could use boost::optional for this?
bool hasOtherHalfEdge;
SurfaceEdge();
std::string toString(void);
};
bool operator == (const SurfaceEdge& lhs, const SurfaceEdge& rhs);

View File

@ -40,7 +40,9 @@ namespace Ogre
void computeNormalsFromVolume(VolumeIterator volIter);
//void decimate(void);
void computeOtherHalfEdges(void);
bool decimate(void);
//bool verticesArePlanar(SurfaceVertexIterator iterCurrentVertex);

View File

@ -38,6 +38,8 @@ namespace Ogre
SurfaceEdgeIterator edge;
SurfaceTriangle();
//std::string toString(void);
};
bool operator == (const SurfaceTriangle& lhs, const SurfaceTriangle& rhs);

View File

@ -48,7 +48,9 @@ namespace Ogre
SurfaceVertex(UIntVector3 positionToSet);
SurfaceVertex(UIntVector3 positionToSet, Vector3 normalToSet);
SurfaceVertex(UIntVector3 positionToSet, Vector3 normalToSet);
std::string toString(void);
};
bool operator==(const SurfaceVertex& lhs, const SurfaceVertex& rhs);