Package com.ardor3d.extension.atlas
Class TexturePacker
java.lang.Object
com.ardor3d.extension.atlas.TexturePacker
A tool that uses the AtlasNode/AtlasPacker algorithm to pack textures into texture atlases. It modifies the uv
coordinates of the meshes, and tries to pack the atlases in a way that works with the wrap modes of the textures
involved.
Simple use case:
// Create a texture atlas packer with maximum atlas size of 256x256 final TexturePacker packer = new TexturePacker(256, 256); // Add meshes into atlas (lots of different ways of doing this if you have other source/target texture indices) packer.insert(mesh1); packer.insert(mesh2); // Create all the atlases (also possible to set filters etc here through the AtlasTextureParameter) packer.createAtlases();
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
createAtlases
(AtlasTextureParameter atlasTextureParameter) int
int
void
insert
(TextureParameter parameterObject) void
void
void
-
Constructor Details
-
TexturePacker
public TexturePacker(int atlasWidth, int atlasHeight)
-
-
Method Details
-
insert
-
insert
-
insert
-
insert
-
createAtlases
public void createAtlases() -
createAtlases
-
getTextures
-
getAtlasWidth
public int getAtlasWidth() -
getAtlasHeight
public int getAtlasHeight()
-