I’m trying to split an single EggGroup into smaller ones.
I can extract all the triangles and add them as EggPolygons according to their bounding box. But then, a lots of vertices will be redundant.
Is there a simple way to optimize the groups to make the polygons share the vertices, or do I need to do it myself when populating the EggGroups ?
Or should I do that with GeomVertex[Reader/Writer] ?
Note that an EggVertexPool is just an organizational construct, as are individual EggVertices. Whether different EggPolygons share the same EggVertexPool, or even the same EggVertex, is largely unrelated to the question of whether the resulting renderable geometry will share vertices.
The egg loader automatically unifies duplicate vertices when possible. It also splits vertices when necessary. These decisions have nothing to do with whether the vertices are shared in the original egg file.
will actually result in some GeomNodes with their own VertexData that should be optimized to contain only the vertices they use. The total number of vertices in VertexData is greater or equal to the length of the VertexPool, since some vertices may be duplicated in the different GeomNodes.