Skip to content

Commit

Permalink
Add setTexelSize
Browse files Browse the repository at this point in the history
  • Loading branch information
huxingyi committed Aug 10, 2019
1 parent 51ce762 commit 3b72880
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion simpleuv.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ HEADERS += simpleuv/chartpacker.h
SOURCES += simpleuv/triangulate.cpp
HEADERS += simpleuv/triangulate.h

SOURCES += simpleuv/meshdatatype.cpp
HEADERS += simpleuv/meshdatatype.h

SOURCES += thirdparty/squeezer/maxrects.c
Expand Down
7 changes: 6 additions & 1 deletion simpleuv/uvunwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ void UvUnwrapper::setMesh(const Mesh &mesh)
m_mesh = mesh;
}

void UvUnwrapper::setTexelSize(float texelSize)
{
m_texelSizePerUnit = texelSize;
}

const std::vector<FaceTextureCoords> &UvUnwrapper::getFaceUvs() const
{
return m_faceUvs;
Expand Down Expand Up @@ -577,7 +582,7 @@ void UvUnwrapper::parametrizeSingleGroup(const std::vector<Vertex> &verticies,
m_chartSourcePartitions.push_back(sourcePartition);
}

float UvUnwrapper::textureSize() const
float UvUnwrapper::getTextureSize() const
{
return m_resultTextureSize;
}
Expand Down
3 changes: 2 additions & 1 deletion simpleuv/uvunwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ class UvUnwrapper
{
public:
void setMesh(const Mesh &mesh);
void setTexelSize(float texelSize);
void unwrap();
const std::vector<FaceTextureCoords> &getFaceUvs() const;
const std::vector<Rect> &getChartRects() const;
const std::vector<int> &getChartSourcePartitions() const;
float textureSize() const;
float getTextureSize() const;

private:
void partition();
Expand Down

0 comments on commit 3b72880

Please sign in to comment.