/** * Applies the texture coordinates to the given geometry * if its DiffuseMap or ColorMap exists in the atlas. * @param geom The geometry to change the texture coordinate buffer on. * @return true if texture has been found and coords have been changed, false otherwise. */ public boolean applyCoords(Geometry geom) { return applyCoords(geom, 0, geom.getMesh()); }
private static void applyAtlasCoords(List<Geometry> geometries, Mesh outMesh, TextureAtlas atlas) { int globalVertIndex = 0; for (Geometry geom : geometries) { Mesh inMesh = geom.getMesh(); geom.computeWorldMatrix(); int geomVertCount = inMesh.getVertexCount(); VertexBuffer inBuf = inMesh.getBuffer(Type.TexCoord); VertexBuffer outBuf = outMesh.getBuffer(Type.TexCoord); if (inBuf == null || outBuf == null) { continue; } atlas.applyCoords(geom, globalVertIndex, outMesh); globalVertIndex += geomVertCount; } }
/** * Applies the texture coordinates to the given geometry * if its DiffuseMap or ColorMap exists in the atlas. * @param geom The geometry to change the texture coordinate buffer on. * @return true if texture has been found and coords have been changed, false otherwise. */ public boolean applyCoords(Geometry geom) { return applyCoords(geom, 0, geom.getMesh()); }
private static void applyAtlasCoords(List<Geometry> geometries, Mesh outMesh, TextureAtlas atlas) { int globalVertIndex = 0; for (Geometry geom : geometries) { Mesh inMesh = geom.getMesh(); geom.computeWorldMatrix(); int geomVertCount = inMesh.getVertexCount(); VertexBuffer inBuf = inMesh.getBuffer(Type.TexCoord); VertexBuffer outBuf = outMesh.getBuffer(Type.TexCoord); if (inBuf == null || outBuf == null) { continue; } atlas.applyCoords(geom, globalVertIndex, outMesh); globalVertIndex += geomVertCount; } }