Add setTexelSize api for simpleuv
parent
dacff70eaa
commit
dc33e2f11c
|
@ -57,7 +57,7 @@ void uvUnwrap(const Outcome &outcome,
|
|||
simpleuv::UvUnwrapper uvUnwrapper;
|
||||
uvUnwrapper.setMesh(inputMesh);
|
||||
uvUnwrapper.unwrap();
|
||||
qDebug() << "Texture size:" << uvUnwrapper.textureSize();
|
||||
qDebug() << "Texture size:" << uvUnwrapper.getTextureSize();
|
||||
const std::vector<simpleuv::FaceTextureCoords> &resultFaceUvs = uvUnwrapper.getFaceUvs();
|
||||
const std::vector<simpleuv::Rect> &resultChartRects = uvUnwrapper.getChartRects();
|
||||
const std::vector<int> &resultChartSourcePartitions = uvUnwrapper.getChartSourcePartitions();
|
||||
|
|
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue