CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csgeom/trimeshlod.h

00001 /*
00002     Copyright (C) 1998,2001 by Jorrit Tyberghein
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_TRIMESHLOD_H__
00020 #define __CS_TRIMESHLOD_H__
00021 
00022 #include "csgeom/math3d.h"
00023 #include "csgeom/trimesh.h"
00024 
00025 class csTriangleVerticesCost;
00026 
00032 class csTriangleVertexCost : public csTriangleVertex
00033 {
00034 public:
00036   bool deleted;
00037 
00039   float cost;
00041   int to_vertex;
00042 
00044   csTriangleVertexCost () : deleted (false) { }
00046   ~csTriangleVertexCost () { }
00048   bool DelVertex (int idx);
00050   void ReplaceVertex (int old, int replace);
00051 
00056   void CalculateCost (csTriangleVerticesCost* vertices);
00057 };
00058 
00065 class csTriangleVerticesCost
00066 {
00067 private:
00068   csTriangleVertexCost* vertices;
00069   int num_vertices;
00070 
00071 public:
00073   csTriangleVerticesCost (csTriangleMesh* mesh, csVector3* verts,
00074         int num_verts);
00076   ~csTriangleVerticesCost ();
00081   void UpdateVertices (csVector3* verts);
00082 
00084   int GetVertexCount () { return num_vertices; }
00086   csTriangleVertexCost& GetVertex (int idx) { return vertices[idx]; }
00087 
00089   void CalculateCost ();
00090 
00092   int GetMinimalCostVertex ();
00093 
00095   void Dump ();
00096 };
00097 
00102 class csTriangleMeshLOD
00103 {
00104 public:
00120   static void CalculateLOD (csTriangleMesh* mesh, csTriangleVerticesCost* verts,
00121         int* translate, int* emerge_from);
00122 };
00123 
00124 
00125 #endif // __CS_TRIMESHLOD_H__
00126 

Generated for Crystal Space by doxygen 1.2.18