3 #include "AtlasGenerator.h"
4 #include <Cry3DEngine/IIndexedMesh.h>
5 #include "TopologyTransform.h"
7 #include "TopologyGraph.h"
8 #include "UVGenerator.h"
10 namespace LODGenerator
12 CAtlasGenerator::CAtlasGenerator()
17 CAtlasGenerator::~CAtlasGenerator()
24 CTopologyGraph
* CAtlasGenerator::surface()
29 void CAtlasGenerator::pack_in_texture_space()
32 packer
.pack_map(surface());
35 void CAtlasGenerator::generate_texture_atlas(bool auto_cut
,bool auto_cut_cylinders
,double max_overlap_ratio
,double max_scaling
, double min_fill_ratio
)
37 if (surface() == NULL
)
40 CTopologyGraphMutator
editor(surface());
41 FOR_EACH_VERTEX(CTopologyGraph
, surface(), it
)
43 editor
.merge_tex_vertices(*it
);
45 CUVGenerator
generator(surface());
46 generator
.set_auto_cut(auto_cut
);
47 generator
.set_auto_cut_cylinders(auto_cut_cylinders
);
48 generator
.set_max_overlap_ratio(max_overlap_ratio
);
49 generator
.set_max_scaling(max_scaling
);
50 generator
.set_min_fill_ratio(min_fill_ratio
);
52 pack_in_texture_space();
56 void CAtlasGenerator::setSurface(IStatObj
*pObject
)
58 m_MeshMap
= CTopologyTransform::TransformToTopology(pObject
);
61 void CAtlasGenerator::setSurface(CTopologyGraph
* meshMap
)